Reading Input from the Form : _GET « Form « PHP






Reading Input from the Form

 
<html>
<head>
<title>A Simple HTML Form</title>
</head>
<body>
<div>
<form action="index.php" method="get">
<p><input type="text" name="user" /></p>
<p><textarea name="address" rows="5" cols="40">
</textarea></p>
<p><input type="submit" value="hit it!" /></p>
</form>
</div>
</body>
</html>


// index.php
<html>
<body>
<div>
 <?php
  print "Welcome <b>" . $_GET ['user'] . "</b><br/>\n\n";
  print "Your address is: <br/><b>" . $_GET ['address'] . "</b>";
  ?>
 </div>
</body>
</html>
  
  








Related examples in the same category

1.Properly Checking for Submission Using Image Widgets
2.Time-Sensitive Form Example
3.Using Arrays with Form Data in PHP