I have a problem, and not even my doctor can help me with this one.
Every time I go to a new page on the website, the session id changes without fail! Which results in the shopping cart items being erased, as you'd expect with being issued a new session id.
This is an extract of the top of every page on my site...
<?php
session_start();
if ( !isset ($cart))
{
session_register("cart");
}
if ( !isset($cart[num_items]))
{
$cart = array("num_items" => 0,
"products" => array());
}
?>
The only way I can keep the session id (and the shopping cart items) is by putting the following in every url link (please note that <? print SID; ?> just puts a ? at the end of the url address and nothing more for some reason.
<a href="index.php?PHPSESSID=<?php print session_id(); ?>">Home</a>
This whole thing falls to pieces on an enquiry form. I want to submit the form using POST rather than GET, and without fail I lose the session id again and all the items in the shopping cart.
Any idea's please.
Thanks,
Richard