Link to home
Start Free TrialLog in
Avatar of fradolcino
fradolcino

asked on

unset POST

i have a input form (method=post), and after the user push the button Submit, the values is insert in a database
i want if the user push F5, or reload page do not insert into the database the post values
i try unset($_POST['value']), doesn't work
also i try unset($_HTTP_POST_VARS); and unset($_POST); same thing
doesn't work
please help
thanks
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Hi,

You can use header('Location:someotherpage') to redirect the user to another page after they have posted. When they then press F5, they are on that new page without POST-data.

-r-
Avatar of fradolcino
fradolcino

ASKER

no, because is a page where a client put some orders, and he MUST see that page with the evolution of the orders
thanks
Yeah, but you can easily redirect to a php page:
header('Location:view_order.php");

-r-
ASKER CERTIFIED SOLUTION
Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
function cleanPostVars(){
    if (isset($HTTP_POST_VARS)) $HTTP_POST_VARS = array();
    if (isset($_POST)) $_POST = array();
    }

cleanPostVars();
But that is of no use as the $_POST data will still be sent when the user presses F5 to refresh the page!
tolgaong. I actually had to grin about your solution. :^D

Although it is what was asked for, you must have noticed that it isn't going to help out with the problem described.

:^D

-r-