RE: [PHP] Re: [Repost] Getting rid of "Web page has expired" (POSTDATA Error)
| From: | Nicolas Verhaeghe | Date: | Thu, 18 May 2006 20:17:43 +0000 |
| Subject: | RE: [PHP] Re: [Repost] Getting rid of "Web page has expired" (POSTDATA Error) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236438@lists.php.net to get a copy of this message | ||
Robert Samuel White wrote:
> You might want to modify your coding. The way I prevent this problem
> from ever happening is this:
>
>
>
> 1. The user completes information on the form.
>
> 2. The form is validated by PHP.
>
> 3. If there are errors, then the form is reshown with their values
> populated.
>
> 4. Once all errors are corrected, I process the form and then use a
> Header("Location: ") to redirect the user to the same page (or
> another page).
>
>
>
> This has the advantage of allowing a user to click the back button
> and seeing their form with their values still intact.
>
>
>
> This prevents a method post page from being in the user's browser
> history.
Now one thing bothers me: how do you redirect in step 4 if you have shown
the form in step 3?
How do you avoid a "Cannot modify header information - headers already sent
by ..." error message?
Nicolas Verhaeghe
E-mail: nicolas@whiteecho.com
Phone: 602-490-8000