Remembering Form information

Posted by Pete Herbert Penito on Stack Overflow See other posts from Stack Overflow or by Pete Herbert Penito
Published on 2010-04-26T21:29:16Z Indexed on 2010/04/26 21:33 UTC
Read the original article Hit count: 185

Filed under:
|

Hi everyone!

I'm sorry if this has been asked before but I feel my situation is a little different...

I have a huge form (like 50 questions involving checkboxes, drop downs, text boxes and textareas)

When a user submits a form and the validation page throws an error, is there an easy way to keep the info they entered?

My intitial form is on form.php and then the form action is form_posted.php, before anything is run on form_posted.php I have my validation code which sends the user back to form.php with an error number (eg. form.php?error=3) if there was a problem with any in particular. This is done with

header("form.php?error=3")

so on form.php do the posted variables exist? even tho the page wasn't specifically sent with any posted variables.

Also if this is the case, is it completely secure to be making the value of a textbox what it was before?

like <input type="text" value="php echo $_POSTED["username"] ?>">

© Stack Overflow or respective owner

Related posts about forms

Related posts about php