Your setting the value of the Friends Discount Session to be equal to the value of the ffreind Discount Session:
$_SESSION["FriendsDiscount"] = "".$_SESSION['FriendsDiscount'] ."";
should'nt it be equal to the value of the friends Discount form element?:
$_SESSION["FriendsDiscount"] = "".$_POST["FriendsDiscount"] ."";
if (!session_id()) session_start();
if((((isset($_POST["FriendsDiscount"]))?$_POST["FriendsDiscount"]:"") != "")) {
$_SESSION["FriendsDiscount"] = "".$_POST["FriendsDiscount"] ."";
}
sounds to me like somewhere along the way, the friends discount session variable got set to 40.
In future for trouble shooting, I find it helps to echo values to the page so you know what is being used behind the scenes:
<?php echo("The Session FriendsDiscount is equal to: ".isset($_SESSION["FriendsDiscount"])?$_SESSION["FriendsDiscount"]:"Nothing"); ?>
<?php echo("The Post FriendsDiscount is equal to: ".isset($_POST["FriendsDiscount"])?$_POST["FriendsDiscount"]:"Nothing"); ?>