Posted by purcaholic on 05/13/07 14:55
Hi Martien,
a header redirect is a simple way to prevent reloading a page several
times. Store your article in "winkelwagen.php" and make a redirect to
another page.
Example:
[snip]
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;
}
header("Location: ./meerinfo.php");
exit;
[/snap]
The redirectiom should done before any output is send to client.
purcaholic
Navigation:
[Reply to this message]
|