1. Home
  2. Computing & Technology
  3. PHP / MySQL

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.
Explore PHP / MySQL
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Step By Steps
  5. Rand PHP Random - PHP else if elseif - PHP Free Game Tutorial

©2009 About.com, a part of The New York Times Company.

All rights reserved.