Posted by Martien van Wanrooij on 05/13/07 14:37
In a simple webshop application I am trying to check that the "shopping
cart" only should be "filled" when you choose an article in "meerinfo.php"
and click on a link to "winkelwagen.php". It works fine in that sense that
when I would enter in the browser "www.mysite.php/winkelwagen?id=5"it will
be ignored.
However when I go from meerinfo.php to winkelwagen.php , the article is
added again and again to the shopping cart when I click on the refresh
button in Internet Explorer. Is there a way to avoid that?
This is the code in winkelwagen.php
if(!isset($_SESSION['artikelen'])) //initiate the array when the first
article is added to the shopping cart
{
$_SESSION['artikelen'] = array();
}
$waarvandaan = $_SERVER['HTTP_REFERER'];
if (strstr($waarvandaan, "meerinfo.php"))
{
$id = $_GET['id'];
$_SESSION['artikelen'][] = $id;
}
Thanks for any help (or suggestions for articles that discuss this topic)
Martien
Navigation:
[Reply to this message]
|