Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-27-2003, 07:07 AM #1
- Join Date
- Mar 2003
- Thanked 0 Times in 0 Posts
Redirect without losing information
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, 04:46 PM #2
- Join Date
- May 2002
- Perth Australia
- Thanked 92 Times in 90 Posts
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.
MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)