<?php

require_once "java/Java.inc";
/* PHP version of numberguess.jsp */
$session = java_session();
if (java_is_null($numguess = $session->get("bean"))) {
    $session->put("bean", $numguess = new Java("num.NumberGuessBean"));
}
if ($_POST['guess']) {
    $numguess->setGuess($_POST['guess']);
}
?>

<html>
<head><title>Number Guess</title></head>
<body bgcolor="white">
<font size=4>

<?php 
if (java_values($numguess->getSuccess())) {
    ?>
  Congratulations!  You got it.
  And after just <?php 
    echo java_values($numguess->getNumGuesses());
    ?>
 tries.<p>

  <?php 
    $session->destroy();
    ?>