html - PHP convert PDF form show me embeded to page -
i have big problem, try lot of things here , google, nothing! have form in php this:
<form action="trimite.php" id="check-in" method="post"> <div class="row row-custom-padding section-index-1"> <div class="column col-md-12"> <div class="container"> <div class="row row-custom-padding"> <div class="column col-md-3"> name<input type="text" class="form-control" id="name" name="name" required="required" pattern="[a-z a-z -]{0,30}" /> </div> <div class="column col-md-2"> date of birth<input type="text" autocomplete="off" class="form-control" id="nastere" name="nastere" placeholder="01.01.1900" required="required" /> </div> <input type="submit" name="submit" value="send" class="btn btn-default"/> <input type="reset" name="reset" value="cancel" class="btn btn-default"/> </div> </div> </div> </div> </form>
this form above ok , working, send form (send.php) same, if want send input e-mail or database send my, big problem is: want save data external pdf , external pdf show me in browser not full screen pdf, this:
and code generate pdf , working don't want fullscreen
<?php if(isset($_post['submit'])){ //collect form data $name = $_post['name']; $email = $_post['email']; //check name set if($name ==''){ $error[] = 'name required'; } //check valid email address if(!filter_var($email, filter_validate_email)){ $error[] = 'please enter valid email address'; } //if no errors carry on if(!isset($error)){ //create html of data ob_start(); ?> <?php echo $name; echo $email; ?> <?php $body = ob_get_clean(); $body = iconv("utf-8","utf-8//ignore",$body); include("mpdf/mpdf.php"); $mpdf=new \mpdf('','a4','','' , 0, 0, 0, 0, 0, 0); $mpdf->cssselectmedia='mpdf'; // assuming used in document header //write html pdf $mpdf->writehtml($body); //output pdf $mpdf->output($name.'.pdf','s'); //open in browser $mpdf->output(); //save server $mpdf->output($name.".pdf",'f'); } } //if errors display them if(isset($error)){ foreach($error $error){ echo "<p style='color:#ff0000'>$error</p>"; } } ob_end_flush(); ?>
thank much!
Comments
Post a Comment