PHP / MySQL

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

Guess The Number Tutorial

By Angela Bradley, About.com

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

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

PHP / MySQL

  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.