<?
  
if ($message) {
    if (
$function == "deposit") { $balance += $amount; }
    else if (
$function == "withdraw") { $balance -= $amount; }
    
$message = "Your balance is: " . $balance;
  } else {
    
$balance = 0;
    
$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>
  <input type="hidden" name="balance" value="<?=$balance?>">
  <input type="hidden" name="message" value="<?=$message?>">
  Press <input type="submit" value="Proceed"> when ready.   
</form>