RE: [PHP] Re: [Repost] Getting rid of "Web page has expired" (POSTDATA Error)
| From: | Nicolas Verhaeghe | Date: | Thu, 18 May 2006 21:20:06 +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-236442@lists.php.net to get a copy of this message | ||
Robert Samuel White wrote:
> [SNIP]
>
> 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
>
> [/SNIP]
>
>
>
> Nicholas,
>
> As long as you haven't outputted anything from your script after the
> form post, you can redirect just fine.
>
> Step 3 and Step 4 are two different steps.
>
> You need something like this:
>
>
> if (isset($_POST["btnSubmit"]))
> {
>
> // validate form
>
> }
>
> if (!$form_passes_validation)
> {
>
> // show form
>
> } else
> {
>
> Header("location: ");
>
> }
Indeed but you specify that you reshow the form and then redirect...