2
Well I have a problem in a form, basically I am taking the information of an HTML form with the POST method for a PHP page, I need to generate a pdf from this form and I managed to do this with mPDF (6.0) until then it is all right, but I can only save 1 pdf, I believe it is because of the file name it is overwriting the file that already exists in the folder.
I wonder if I can create something like an auto increment to avoid files with the same name, or if I can use a variable to take a form field and use it as the name.
Follow the PDF output code with the mPDF class:
$mpdf=new mPDF();
$mpdf->SetDisplayMode('fullpage');
$css = file_get_contents("css/estilo.css");
$mpdf->WriteHTML($css,1);
$mpdf->WriteHTML($pdf);
$mpdf->Output('-local-\form.pdf', 'F');
Like I said it’s working but I can only keep 1 file saved.
Thank you in advance.
What if two online users submit the form at 06:47:11 of 1°/08/2017?
– C. Bohok
I had forgotten to implement the milliseconds. And I agree that without the milliseconds two requisitions were possible to occur at the same time.
– DNick
Fair and perfect!
– C. Bohok
It worked perfectly thank you!
– HBretone