Using PHP Variables with a Header

From: Date: Tue, 10 Jul 2001 00:10:23 +0000
Subject: Using PHP Variables with a Header
Groups: php.general 
Request: Send a blank email to php-general+get-57041@lists.php.net to get a copy of this message
I have a form that requires a user to enter various information (name, address, phone number, etc...). When they submit this form, the next PHP page checks to make sure that the required fields were filled in. What I would like to do is check to see if the required fields are all filled in and if they are not, save the values they submitted and go back to the original page, display a message that says the fields that need to be filled in and populate the rest of the fields with the information the user orignally submitted. This will keep them from having to type in all of the information again. I can run the checks just fine to see if the required fields are all filled in. I then save the data from all the fields into variables. What I would like to do is automatically forward the user back to the original page with the values (i already have all of the fields set with "value="$variablename"" to allow them to get the data that is sent back). The only way I have been able to get this to work is to set this up as a regular form with hidden HTML fields and a Submit button. I really want this to be an automatic process. Any thoughts on how to accomplish this? When I set up a "Header", the user is forwarded back to the page that I want, but none of the variables go with them (they are set by simply putting something like "$savedlastname = $lastname, where $lastname is the HTML variable from the original form). Any help is appreciated.

« previous php.general (#57041) next »