When I use GET my forms work but POST fails
Hi, I am new to Web programming and Dreamweaver and have spent over a week trying to get the form method POST to work. If I use GET all is well but POST fails. I get an "Undefined index: mytest on line 11 of program aato. Please let me know what am I failing to do?
My configuration is:
HP Laptop Intel 2 Duo 2.66MHz 4GB
Windows 7 Home premium
Dreamweaver CS5
============================= Program aafrom =========================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div id="test">
<form id="form1" name="form1" method="post" action="aato.php">
<p>
<label>Input
<input type="text" name="mytest" id="mytest" tabindex="10" />
</label>
</p>
<p>
<input type="submit" name="submit" id="submit" value="Submit" tabindex="30" />
</p>
</form>
</div>
</body>
</html>
============================= Program: aato =========================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div>
<form id="form1" name="form1" method="post" action="">
<?php $input = $_POST['mytest']; // I have tried $_POST and $_GET with and without a <form ......>
echo $input;
?> </form>
</div>
</body>
</html>
