PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I can't seem to get my session variable append up a value when an add button is pressed. The variable keeps reseting to 1. I want to be able to add 1, everytime a button is clicked.
<?
$set = 0;
if(!isset($_SESSION['trueset'])){
echo "Session not set<br>";
}
else{
echo $_SESSION['trueset'];
}
if(!isset($_SESSION['trueset'])){
$_SESSION['trueset'] = $_GET['trueset'];
setcookie("trueset", $_SESSION['trueset'], time()+60*60*24*100, "/"); [color=#FF0000]/* I thought maybe setting the session as a cookie might help the initial set value stick */[/color]
}
if(isset($_POST['addaset_x'])){ [color=#FF0000]/* addaset is a name of submit button within a form */[/color]
$trueset = $_SESSION['trueset'] + 1;
header( "Location: http://www.url.com/membersarea/ButtonTe ... t=$trueset" );
}