View Full Version : Redirect without losing information
03-27-2003, 08:07 AM
How to Redirect a page to the other page with the values in the text fields retained. i.e, Page 1 gets the information from the user, validates the information in the page 2 and it needs to redirect again to page 1, if the informations are not valid. Thnx. Bye
03-27-2003, 05:46 PM
easiest way is to do everything on page 1.. i.e. page1.htm has a form action of page1.htm , page1 itself decides if it is supposed to be processing or showing the form.
//if process success
//still here ? - show the form
<input type="text" name="field" value="<?=$_POST['field'];?>">
another way is to store all $_POST & $_GET data in a session which you can pass from page to page really easily.
so on page2.htm , process the form, if there are errors you can add the form data to a session & send back to page1 (or indeed anywhere else..
//error occurs ?
page1.htm ... if the post_data exists we can use it.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.