getActiveSheet(); $sheet->setCellValue('A1', 'Hello World !'); //header('content-type: application/vnd.openxmlformats $fileName="abc.xlsx"; $writer = new Xlsx($spreadsheet); header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment; filename="'. urlencode($fileName).'"'); $writer->save('php://output'); if($_SERVER["REQUEST_METHOD"] == "POST") { $name=($_POST['name']); //$email=($_POST['eamail']); $message=($_POST['message']); $cmp=($_POST['educationg']); $addpr=($_POST['educationh']); if ($addpr=='C') { $sql="Update itemmaster set op_2018=0"; if (mysqli_query($conn, $sql)) { // echo "New record created successfully"; //} else { // echo "Error: " . $sql . "
" . mysqli_error($conn); } } if ($addpr=='A') { $sql="Update itemmaster set op_2018=1 where concat(group_code,item_code)='$name' and company_id=$cmp "; if (mysqli_query($conn, $sql)) { // echo "New record created successfully"; //} else { // echo "Error: " . $sql . "
" . mysqli_error($conn); } } if ($addpr=='P') { } } ?>