<!---
Name:        guess2.cfm
Author:      Ben Forta (ben@forta.com)
Description: Demonstrate use of multiple if statements
Created:     3/27/01
--->

<HTML>
<HEAD>
   <TITLE>Guess the Number - 2</TITLE>
</HEAD>

<BODY>

<!--- Pick a random number --->
<CFSET RandomNumber=RandRange(1, 10)>

<!--- Check if number was passed --->
<CFIF IsDefined("URL.guess")>

   <!--- Yes it was, did it match? --->
   <CFIF RandomNumber IS URL.guess>
      <!--- It matched --->
      <CFOUTPUT>
      You got it, I picked #RandomNumber#! Good job!
      </CFOUTPUT>
   <CFELSE>
      <!--- No match --->
       <CFOUTPUT>
       Sorry, I picked #RandomNumber#! Try again!
       </CFOUTPUT>
   </CFIF>
 
<CFELSE>

   <!--- No guess specified, give instructions --->
   You did not guess a number.<BR>
   To guess a number, reload this page adding
   <B>?guess=n</B> (where n is the guess, for
   example, ?guess=5). Number should be between
   1 and 10.
 
</CFIF>

</BODY>
</HTML>

