I have the following code in two files separately
file one.php
<HTML>
<BODY>
<FORM ACTION="two.php" METHOD="POST">
Age: <INPUT TYPE="text" NAME="age">
<INPUT TYPE="submit" VALUE="OK">
</FORM>
</BODY>
</HTML>
file dos.php
<HTML>
<BODY>
<?PHP
print ("The age is: $age");
?>
</BODY>
</HTML>
the age variable is not recognized, someone knows fix?
Your trying to access the value of age from a page( dos.php) but you posting it to (two.php) and your missing $_POST['age'].
one.php
two.php
It's not recognized because you don't create it. Variables don't magically appear in PHP1. You need to get that value from the
$_POST
superglobal:1 Anymore. They used to when register_globals existed. But that has been obsolete since long before you started coding.