Re: How to make sure a redirect works
| From: | John W. Holmes | Date: | Wed, 17 Mar 2004 12:04:41 +0000 |
| Subject: | Re: How to make sure a redirect works | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-180671@lists.php.net to get a copy of this message | ||
Benjamin wrote:
Henry Grech-Cini wrote: 1) Do not redirect if the page is visited as the result of a POST Why is that? I do it all the time and it seems to work fine. I have read through all the emails for this thread and didn't find anything mentioned. Am I doing something wrong?No, you're doing it right. If you don't do a redirect and someone tried to come _back_ to a page that was POSTed to, they'll have to refresh it to see it again (rePOST the data). This is why the "middle-man" technique is so popular. You POST to a PHP page that handles processing and then redirects to a page to show the user. This way there's no need to refresh when/if the user comes back to it. Keep in mind I'm jumping into the middle of this thead as I just resubscribed. :) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com