faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

61 of 83 people (73%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How can I remember data from the first page through a multi-page form?

Aug 4th, 2000 14:36
Ben Munoz, Nathan Wallace, Nathan Wallace


Using hidden fields is the best way to pass and keep data through your
multi-page forms.  For example:
    <input type=hidden name="firstformvar" value="<? echo $var ?>">
You should probably check that the input from the user is valid
immediately after they enter it, that way you can report any errors
straight away.
If you are really paranoid then you should recheck all of the
information at the end of your form sequence.  Malicious users could
hack the html source and change the hidden fields to suit their needs.
-------------------------------------------------------------------
If you are using PHP4, then you can store this submitted information in 
session variables for use by a later form.