Multiple Calls to POST data cause error with pdf generation
-
I have a form page and a pdf (generated with mpdf).
On the form page is the code:<form method="POST" action="/posted.php"> <input type="text" name="word[]" value="hi" /> <input type="submit"> </form>
On the pdf generation page is:
<?php shuffle($_POST['word']); shuffle($_POST['word']); shuffle($_POST['word']); shuffle($_POST['word']); shuffle($_POST['word']); include_once($_SERVER['DOCUMENT_ROOT']."/mpdf/mpdf.php"); $mpdf=new mPDF(); $mpdf->WriteHTML(); $mpdf->Output(); ?>
This will cause the pdf to not render in vivaldi (it works fine in Firefox, Chrome, Opera, Safari).
Alternatively you could substitute the shuffles for any other action that calls the $_POST variable.
ie:<?php array_reverse($_POST['word']); array_reverse($_POST['word']); array_reverse($_POST['word']); array_reverse($_POST['word']); array_reverse($_POST['word']); include_once($_SERVER['DOCUMENT_ROOT']."/mpdf/mpdf.php"); $mpdf=new mPDF(); $mpdf->WriteHTML(); $mpdf->Output(); ?>
If you remove even one of the calls to the POST data it does render fine though.
Ie:<?php shuffle($_POST['word']); shuffle($_POST['word']); shuffle($_POST['word']); shuffle($_POST['word']); include_once($_SERVER['DOCUMENT_ROOT']."/mpdf/mpdf.php"); $mpdf=new mPDF(); $mpdf->WriteHTML(); $mpdf->Output(); ?>
-