1. Computing & Technology

Discuss in my forum

Guess The Number Tutorial

By , About.com Guide

3 of 3

Guessing Form
 <form action = "<?php echo $_SERVER[’PHP_SELF’]; ?>" method = "post"> <p> 
 //this sends the form back to the same page we are on 
 
 Your Guess:<input name="Num" /> 
 <input type = "submit" name = "Guess"/> <p> 
 //Allows the user to input their guess 
 
 <input type = "hidden" name = "x" value=<?php echo $x ?>> 
 //keeps passing along the x value to keep it consistent till it is guessed 
 
 </form> 
 </body> 
 </html> 
This HTML form allows the user to submit their guess. It then sends the data back to itself to be processed.

©2012 About.com. All rights reserved.

A part of The New York Times Company.