You are here: Re: Destroy $_POST vars after use - is it possible? « PHP Programming Language « IT news, forums, messages
Re: Destroy $_POST vars after use - is it possible?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация