General use of rewrite / redirect

From: Date: Tue, 18 Mar 2008 10:55:28 +0000
Subject: General use of rewrite / redirect
Groups: php.general 
Request: Send a blank email to php-general+get-271705@lists.php.net to get a copy of this message
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....'/

« previous php.general (#271705) next »