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. Quote 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(); Quote 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.. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.