Jump to content

How Process form in the same Page


nivekz

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.