nivekz Posted September 13, 2011 Share Posted September 13, 2011 Hey guys my code is like this <?php if( $_POST["name"] || $_POST["age"] ) { echo "Welcome ". $_POST['name']. "<br />"; echo "You are ". $_POST['age']. " years old."; exit(); } ?> <html> <body> <form action="<?php $_PHP_SELF ?>" method="POST"> Name: <input type="text" name="name" /> Age: <input type="text" name="age" /> <input type="submit" /> </form> </body> </html> The Inputs are taken from form.How do I make it display somewhere at the bottom of the form in the same page.The Output of this code comes up in a new page. Link to comment https://forums.phpfreaks.com/topic/247068-how-process-form-in-the-same-page/ Share on other sites More sharing options...
JKG Posted September 13, 2011 Share Posted September 13, 2011 remove exit(); Link to comment https://forums.phpfreaks.com/topic/247068-how-process-form-in-the-same-page/#findComment-1268830 Share on other sites More sharing options...
AyKay47 Posted September 13, 2011 Share Posted September 13, 2011 by using exit() in your if conditional, you are terminating any code below it.. Link to comment https://forums.phpfreaks.com/topic/247068-how-process-form-in-the-same-page/#findComment-1268832 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.