| 
	
 | 
 Posted by lister on 05/30/07 10:40 
Hi all, 
 
Just wondering whether there was any standard way of serving up a new 
page to the browser when the user has submitted the current page. 
 
Currently I: 
1) Process any user submitted data in the current page 
2) Send a header('location') redirect to the browser, which then 
requests the new page. 
 
I was considering that is it probably more efficient PHP to serve up 
the new page contents immediately, without requiring another HTTP 
request from the browser and the subsequent PHP setup overhead. Also 
this would prevent having to store stuff in the user session to 
maintain state.  I was going to try this with require(), but 
immediately hit problems in that my pages have functions called the 
same thing, so PHP falls over. Upon thinking about it further I could 
can also see possible problems with $_POST data containing stuff from 
the old page that could screw up the new page, and possible wierdness 
with the browser address bar still having the old page address. 
 
Is there an accepted way of doing this? Or is just a case of weighing 
up the pro's and cons. 
 
Cheers, 
Lister
 
  
Navigation:
[Reply to this message] 
 |