Print form with: 1.foto sent in post 2. id auto increment generated in form insert. In PHP there's how?


When registering the form, the user will upload the photo, so far so good.

My problem is that I need to print this form already with the photo and the bank's auto increment id . The idea was to register the data 60 fields along with the photo and at the end of this registration a submit button and the print event.

I've already used window.print and so I can't recover the photo nor the id just print what was typed.


In your form, when submitting it, you can use foreach to register the data in the database, as shown in the example:

foreach($_POST as $campo => $valor){
    echo "No campo $campo tem o valor $valor<br>";

With these values ​​retrieved and already inserted in the database, you can then check the last registered id, to show it on the page. That is the goal.

Remember that the field name of your form must be the same name that is in the database.

Scroll to Top