php emptying $_post
hello
i am having a play trying to create a simple shopping checkout, using code, no specialist software.
everything is working fine, except when i add or delete an item, and refresh the page, the add/delete is being repeated. which is obviousley bad.
i've tried unsetting the $_posts and emptying any variable being used, but this isn't doing the trick. any ideas....p.s, i'm trying to get the delete item code to work first, so have not altered my add item code.
to test the page, go to http://www.malcmabe.co.uk/custdetails.php
create a username and password using the top columns.click on search for items, and type 'nike' into the search box. click on one of the products and then add x amount to the basket.
if you then f5 refresh, the process is repeated.
in the item code column, type in the item code of the product you have chosen, and choose a quantity to delete. this will delete fine, but if you f5 refresh, another deletion takes place.
here is the code for deletion process:
if(isset($_POST['delitem']))
{
$code = $_POST['itemcode'];
$quant = $_POST['delquant'];
print("<br/> ".$code." ".$quant);
mysql_query("delete from checkout where itemid = '$code' and username = '$username' LIMIT $quant ");
unset($_POST['delitem']);
unset($_POST['itemcode']);
unset($_POST['delquant']);
$code = null;
$quant = null;
}
i would appreciate any help. thanks
