<? session_start();
  
  if (
session_is_registered("message")) {

    if (
$function == "deposit") { $balance += $amount; }
    else if (
$function == "withdraw") { $balance -= $amount; }
    
$message = "Your balance is: " . $balance;

  } else {
    
    
session_register("balance");
    
$balance = 0;
    
session_register("message");
    
$message = "Welcome, your balance is 0 (zero).";
  }
?>

<form>
  <?=$message?> <p>
  Choose an action: <select name="function">
    <option value="nothing"> Click me!
    <option value="deposit"> Deposit
    <option value="withdraw"> Withdraw
  </select> <p>
  Enter amount: <input type="text" name="amount"> <p>

  Press <input type="submit" value="Proceed"> when ready.   
</form>