General use of rewrite / redirect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

In too many projects / scripts / examples, I see rewrites or redirects being done like (pseudocode):

if (good) {
   do something
} else {
   header (location: http://otherpage)
   exit
}

Is this a best practice? What arguments are there to use this kind of mechanism?

I've seen form processing being done, when finished it gets a header redirect to a 'succes' page. I've seen URL's with wrong or insufficient parameters being redirected this way. I've seen too many horrible things that actually belongs into a black book of webscripting.

What is your opinion about (ab)using rewrites / redirects? Do you use it quick and dirty, or is it some elegant way of controlling flow?

Thanks.
--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other....'/

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux