Form Handling

Create a file form.html:

<form method="GET" action="welcome.php">
  Name: <input type="text" name="username">
  <input type="submit">
</form>

In welcome.php:

<?php
echo "Welcome " . $_GET["username"];
?>

Explanation:

  • When you submit the form, username value is sent to welcome.php.
  • Example: If you type Saim, it shows Welcome Saim.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *