Re: Clear POST variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 16, 2006 at 01:23:23PM -0600, Richard Lynch wrote:
> On Thu, February 16, 2006 9:07 am, Mike Tuller wrote:
> > How do I clear out the POST variables, or the variables that I have
> > set from the POST variables, so that when the page is refreshed it
> > will not resubmit.  I have tried unset() and have tried to set it to
> > and
> > empty value, but it doesn't seem to work.
> 
> You can't clear out the POST variables -- they are SENT by the browser
> to you.
> 
> The simplest solution is to set up a one-time-use token and embed that
> in your FORM data:
> 
> <?php
> $connection = mysql_connect('localhost', 'username', 'password') or
> die(mysql_error());
> 
> if (isset($_POST['example'])){
>   $token = $_POST['token'];
>   $query = "delete from token where token = '$token'";

I usually use a session based token but i guess it the result is
the same.

Curt.
-- 
cat .signature: No such file or directory

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux