|
Posted by Simon Stienen on 08/02/05 13:09
On 2005-08-02 10-38-02 daemon <d43m0n@shaw.ca> wrote:
> bissatch@yahoo.co.uk wrote:
>> Hi,
>>
>> How would I go about destroying POST vars after their use in a script?
>> Is this possible?
>>
>> The reason is that when I use a script that, for example, add a row to
>> a database. If for some reason the user refreshes the page, it will add
>> another row. Is it the browser that resends the POST vars when a page
>> is refreshed?
>>
>> Whats the common way to avoid this?
>>
>> Cheers
>>
>> Burnsy
>>
>
> You can do this by simply using unset($_POST); since its just a normal
> array of varibles...
You could either send back a 205 Reset Content (see
<http://www.faqs.org/rfcs/rfc2616.html>) to clear the form or use a 307
Temporary Redirect (same page), to redirect the user to another page after
processing the form data.
HTH,
Simon
--
Simon Stienen <http://slashlife.org/>
"What you do in this world is a matter of no consequence,
The question is, what can you make people believe that you have done."
/Sherlock Holmes in A Study in Scarlet by Sir Arthur Conan Doyle/
Navigation:
[Reply to this message]
|