I have a from that has NEW a hidden variable. Lets say the variable from previous submission was 2.
<?php echo $variable = 3;
echo $variable; //displays 3
?>
<form action="functions/store.php" method="post">
<input type="hidden" name="variable" value="<?php echo $variable ;?>">
<input type="submit" value="Submit" />
When running the code to store it in the data base, it stores the variable form the previus submission: 2. Why is that. The code I in store.php run is:
$variable= $_POST['variable'];
echo $variable; //displays 2. Should display 3
$stmt = $dbh->prepare("INSERT BlahBlahBlah... //other code
I have no idea what's going on even unset($variable) before $_POST does not work.
It worked fine for a while then, it started to behave like this. Even tried on other browser - same result