I would like to start a variable at the number 20. And each time a form is submitted and the page calls itself, the number diminish by 1 and the new number displayed. So the first time the page is loaded, "20" would appear, and the next time, 19, and so on.
Here is what I have...
<?
if (!isset($_POST['submit'])) {
$time=20;
}
else {
$time=($time-1);
}
?>
<html>
<body>
<? echo $time; ?>
<form method="POST" action="test.php">
<input type="submit" value="Change time" >
</form>
</body>
</html>
Where am I going wrong? Any help would be great!
Thanks!
Chris