I have been trying to pass a variable between pages so as to tally up a score on a quiz, for some reason the variables aren't passing between the pages as I want them to, I want the score to be 1 if the first button is hit, and it to be 2 if the second is hit, as of now which ever one I hit the result is always 0.
1st Page - minus a whole load of styling:
<?PHP
$Score=0;
if ( isset( $_POST['Submit1'] ) ) {
$Score=$Score+1;
}
if ( isset( $_POST['Submit2'] ) ) {
$Score=$Score+2;
}
?>
<body>
<center><img src="http://fc06.deviantart.net/fs70/f/2011/002/d/3/purple_blob_pet_by_bunni0222-d36aw4q.png" alt="" align="middle"/></center>
<FORM NAME ="form1" METHOD ="POST" ACTION ="Test1.php">
<INPUT TYPE = "Hidden" Name = "h1" Value = <?PHP echo $Score; ?> >
<center><INPUT TYPE = "Submit" class=myButton Name = "Submit1" VALUE = "1"></center>
<center><INPUT TYPE = "Submit" class=myButton Name = "Submit2" VALUE = "2"></center>
</FORM>
</body>
This is the complete second page:
<html>
<head>
<title>Test</title>
</head>
<body>
<p>
<?php
$Score = 0;
//error_reporting(0);
$Score = $_POST['h1'];
echo $Score;
?>
</p>
</body>
</html>
I would appreciate the help, if it is something stupid I apologise i am just learning how to write html and php.