Hello all this question is similar to my last thread but it still is a problem.
Can anyone tell me why this code works fine, but the code after that does not.
I used this exact code:
(it.php)
<form action="action.php" method="GET">
Your name: <input type="text" name="name" />
Your age: <input type="text" name="age" />
<input type="submit">
</form>
(action.php)
Hi <?php echo $GET['name']; ?>.
You are <?php echo $GET['age']; ?> years old.
Output being: Hi Dan. You are 21 years old.
But when I try this code it does not work as expected(exactly same as the last code but POST substituted for GET):
(it.php)
<form action="action.php" method="POST">
Your name: <input type="text" name="name" />
Your age: <input type="text" name="age" />
<input type="submit">
</form>
(action.php)
Hi <?php echo $POST['name']; ?>.
You are <?php echo $POST['age']; ?> years old.
I get the output: Hi . You are years old.
I was under the impression that the results would be identical for both codes. Any help would be greatly appreciated, i've spent the better part of a week trying to figure this out.