jaikhsh Posted July 16, 2007 Share Posted July 16, 2007 <html> <head> <title>PHP Test</title> </head> <body> <form action="phptest.php" method="post"> <p>Your name: <input type="text" name="name" /></p> <p>Your age: <input type="text" name="age" /></p> <p><input type="submit" /></p> </form> </body> </html> this is an html page : "phptest.html" html> <head> <title> Php test </title> </head> <body> <?php extract($_GET); echo $id; ?> Hi <?php echo htmlspecialchars($_GET['name']); ?>. You are <?php echo (int)$_GET['age']; ?> years old </body> </html> an this is php page: "phptest.php" output: -->Your name: -->Your age: --> submit but i'm getting the output as: --> Hi . You are years old is there any mistake in my code. plz do tell me Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted July 16, 2007 Share Posted July 16, 2007 Have a read of this: http://www.w3schools.com/php/php_forms.asp Regards ACE Quote Link to comment Share on other sites More sharing options...
mosi Posted July 16, 2007 Share Posted July 16, 2007 You use method:POST in your form: <form action="phptest.php" method="post"> But in later on you use $_GET. Either change method to GET or change your $_GET's to $_POST Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.