<?
  
if ($message) {
    
$sum = $sum + $user;
    if (
$sum >= 100) {
      
$message = "You enter: " . $user . "<p> You won: " . $sum;
    } else {
      
$comp = rand(1, 10);
      
$sum += $comp;
      if (
$sum >= 100) {
        
$message = "You entered: " . $user . "<p> Computer enters: " .
                   
$comp . " <p> Computer won: " . $sum;
      } else {
        
$message = "You entered: " . $user . "<p> Computer enters: " .
                   
$comp . " <p> Game still going. <p> " .  
                   
"Current sum is: " . $sum;
      }
    }     
  } else {
    
$sum = 0;
    
$message = "Welcome, the sum is: " . $sum;
  }
?>

<form>
  <?=$message?> <p>
  Please enter your number: <input type="text" name="user"> <p>
  <input type="submit" name="action" value="Proceed"> when ready.
  <input type="hidden" name="message" value="<?=$message?>">
  <input type="hidden" name="sum" value="<?=$sum?>">
</form>