php - download pdf file of form and also save data in database server -


i need know how can save data in database , download pdf file of @ same time. had done these 2 task separately need perform these 2 task together. code have saving data in database not downloading pdf file of here code

$connection = mysql_connect('localhost', 'sujdhuj', 'msrqt0g(pqbx'); mysql_select_db('sujdhuj_dawooddb',$connection); if(!$connection){     die("connection failed:" .mysqli_connect_error()); } echo "connection hogya successful"; $sno= $_post['sno']; $clientname= $_post['clientname']; $contactno = $_post['contactno']; $dos= $_post['dos']; $start= $_post['start']; $end= $_post['end']; $dow= $_post['dow']; $location= $_post['location']; $osi= $_post['osi']; $emhr= $_post['emhr']; $er= $_post['er']; $mir= $_post['mir']; $ea= $_post['ea']; $cr= $_post['cr']; $mir1= $_post['mir1']; $am= $_post['am']; $ca= $_post['ca']; $date= $_post['date']; $check= $_post['option_3'];  //$image= $_post['image'];  $sql= "insert surveyform(sno, clientname, contactno, dos, start, end, dow, osi, emhr,    er,  mir,    ea,   cr,    mir1,    am,   ca,   date, image)   values('$sno', '$clientname', '$contactno', '$dos','$start', '$end', '$dow', '$osi', '$emhr', '$er','$mir', '$ea', '$cr', '$mir1', '$am', '$ca', '$date' ,'$image')";      if(!mysql_query($sql))     {         die('caution record not added' . mysql_error());     }         echo"1 record added";  require("fpdf/fpdf.php"); $pdf= new fpdf();  $pdf->addpage(); $pdf->setfont("arial","i","15"); $pdf->cell("0","10","welcome form {$sno}","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","client name","1","0","c"); $pdf->cell("80","10","$clientname","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","contact no","1","0","c"); $pdf->cell("80","10","$contactno","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","date of service","1","0","c"); $pdf->cell("80","10","$dos","1","0","c"); $pdf->ln(10); $pdf->cell("0","10","dates ","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","start time","1","0","c"); $pdf->cell("80","10","$start","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","end time","1","0","c"); $pdf->cell("80","10","$end","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","duration of work","1","0","c"); $pdf->cell("80","10","$dow","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","location","1","0","c"); $pdf->cell("80","10","$location","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","other special instruction","1","0","c"); $pdf->cell("80","10","$osi","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","estimated man hours required","1","0","c"); $pdf->cell("80","10","$emhr","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","equipment required","1","0","c"); $pdf->cell("80","10","$er","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","manager/ surveyor in-charge remarks","1","0","c"); $pdf->cell("80","10","$mir","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","estimate amount","1","0","c"); $pdf->cell("80","10","$ea","1","0","c");  $pdf->ln(10); $pdf->cell("110","10","client remarks:","1","0","c"); $pdf->cell("80","10","$cr","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","manager/ surveyor in-charge remarks:","1","0","c"); $pdf->cell("80","10","$mir1","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","account manager","1","0","c"); $pdf->cell("80","10","$am","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","customer name:","1","0","c"); $pdf->cell("80","10","$ca","1","0","c"); $pdf->ln(10); $date=date('f j, y'); $pdf->cell("110","10","date","1","0","c"); $pdf->cell("80","10","$date","1","0","c"); $pdf->ln(10); $pdf->cell("110","10","checkbox value","1","0","c"); $pdf->cell("80","10","$check","1","0","c");  $pdf->output("d", 'filename.pdf' ); 


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -