Re: Setting a cookie and redirecting
| From: | Justin French | Date: | Wed, 03 Jul 2002 03:10:15 +0000 |
| Subject: | Re: Setting a cookie and redirecting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-105112@lists.php.net to get a copy of this message | ||
on 03/07/02 11:54 AM, Richard Lynch (rich@phpbootcamp.com) wrote:
> Rule of Thumb:
> If you have to do header("Location: ...") you have a
> design/engineering/organizational problem in your code/pages/site.
>
> I'm sure a zillion people will disagree with this "rule"
I agree, except there's one exception to this that I can't see a way around.
When dealing with form submissions the receiving file needs to validate all
the code before anything is sent to the browser, update the database (or
whatever) and then redirect to itself with some sort of GET flag that issues
a thankyou note or something.
Otherwise people can hit "refresh" and post the data twice, or 10 times :)
I can't see any SERVER SIDE way around this.
Justin French