You are here: Changing pages: header('location') or PHP require()? « PHP Programming Language « IT news, forums, messages
Changing pages: header('location') or PHP require()?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация