HI folks,
Most of you will know my story, but here it is.
Users come to my site, and off the homepage, apart from the contact and about pages every other page is a html form.
From there they select a size, small medium or large from radio buttons, submit the form and are directed toa php form, on which I have stored the size they selected in their $_SESSION, i.e, on the php form I start:
<? session_start();
$_SESSION['size'] = $size;
?>
After they have filled out their info they are then taling to a payment page, which displays a different Paypl button depending on the size they selected on the first form, using if ($_SESSION['size'] = "small") { and so on.
But now, if my users decide to go back and pick a different size, when they get to the payment screen it still displays the payment buttong for the original size they selected.
Is there anyway to kill any existing sessions, start a new session and assign my variables, when they come onto the second form, and if no previous session exists then statrt a new one and assign my variables.
I've tried putting the following on the top of the second form;
<? if (isset($SESSION)) {session_destory(); session_start;
$SESSION['size'] = $size
}
else { session_start();
$_SESSION['size'] = $size
}
?>
I have also tried adding: session_regenerate_id in between session_destroy() and session_start() in the if argument.