Can anyone tell me why this program doesnt work properly? Its from a PHP 5 book as well! I copied it from the author's CD, just wondering whats wrong. He says he tries to pass the value in hidden input box. And the value increments by one every time you click the submit button. Any ideas? Thanks.
<html>
<head>
<title>
persistence demo
</title>
</head>
<body>
<h1>Persistence Demo</h1>
<form>
<?
//increment the counters
global txtBoxCounter++;
$txtBoxCounter++;
$hdnCounter++;
print <<<HERE
<input type = "text"
name = "txtBoxCounter"
value = "$txtBoxCounter">
<input type = "hidden"
name = "hdnCounter"
value = "$hdnCounter">
<h3>The hidden value is $hdnCounter</h3>
<input type = "submit"
value = "click to increment counters">
HERE;
?>
</form>
</body>
</html>