arrays - How to display records below form on submission in php without the use of database? -


How to use the hidden variable as an array in order to continuously store the data so that they can display the record list Can be used for.

I have a form with 4 text fields and a file upload field ... As I have submitted it, it should be added to the list which must be displayed below the form, such as That these values ​​are not stored in DB.

So in this case how can I use the post array to collect data and display in the list below?

You can use the hidden input field to pass the input page to the next page. Example:

  & lt; Form method = "post" & gt; Name: & lt; Input type = "text" name = "name []" /> & Lt; Input type = "submit" value = "add" /> & Lt ;? Php foreach ($ _POST ['name'] as the $ name) {echo '& lt; Input type = "hidden" name = "name []" value = "'. $ Name." "/> & Gt;'; }? & Gt; & Lt; / Form & gt; & Lt ;? Php print_r ($ _ POST ['name']); ? & Gt;  

However, it will not work for uploaded files. You have to save them and save the filename in the form to save them.

There is an option to use it. These allow you to save some user data between page hits.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -