|
Posted by Christoph Burschka on 05/15/07 10:06
Geoff schrieb:
> "Dave Mennenoh" <dave@blurredistinction.com> wrote in message
> news:46433f8b$0$9885$4c368faf@roadrunner.com...
>
>>I have a form - a voting page where a user clicks 'naughty' or 'nice'...
>>this part works fine. When they refresh thepage though, I want it to be
>>like they never voted. Currently, I get the warning saying the page
>>contains postdata and and blah blah blah... I've tried every header mod I
>>know of, and I continue to get the error.
>>
>>How to fix?
>
>
>
> use get instead of post ?
>
> send a location header after they have posted, so it sends em to another
> page right away ?
>
>
The latter is correct.
Send the form via post, process it, and then (*before* generating any
output) do this:
header("HTTP/1.1 303 See Other");
header("Location: /your/web/form.php");
It will work without the 303 response, but for standards compliance you
should send it. It's defined by W3C as the proper response code for
redirecting the user after a form submission:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4
--
cb
Navigation:
[Reply to this message]
|