Re: Clearing POST variable on page refresh

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

 



Beauford wrote:
I have a page with a form on it which posts to itself. The problem is when
someone refreshes the page it enters the data into the DB again. How do I
clear these variables so that doesn't happen. I tried the unset function,
but no luck. I really don't want to use sessions or cookies as this is just
a simple little page, but still, it has to work right.

Use the header function (http://php.net/header) to redirect to the same page. The POST vars are coming from the client, so you can't get rid of them by unsetting them. By redirecting you are giving the browser a new page which is then what will be retrieved if the user refreshes it, rather than refreshing the POSTed request.

-Stut

--
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