I am having problems retrieving data from forms. This is the code I used:
<html>
<body>
<form action="<?php echo $PHP_SELF;?>" method="POST">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" name="submit" value="submit"/>
</form>
<?php
$name = $POST['name'];
$age = $POST['age'];
$cons = 5;
?>
-<?php echo $_POST ?>-
<p>|<?php echo $name; ?>|</p>
<p>|<?php echo $age; ?>|</p>
<p>|<?php echo $cons; ?>|</p>
<?php phpinfo(); ?>
</body>
</html>
I was using some examples from some tutorials, but I don't see what I am doing wrong. The reason $cons is there was to just make sure I wasn't doing somehting really dumb.
This is the output:
Name: Age:
||
||
|5|
PHP Logo
PHP Version 4.0.6
What am I doing wrong? (also, I have no control over what version of PHP is being used)