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 towelcome.php
. - Example: If you type Saim, it shows
Welcome Saim
.
Leave a Reply