fork download
  1. <?php
  2. if (isset($_POST['a']) && isset($_POST['b'])) $a = $_POST['a'] + 1;
  3. else if (isset($_POST['a']) && isset($_POST['c'])) $a = $_POST['a'] - 1;
  4. else $a = 0;
  5. ?>
  6. <form method="post" action="<?=$_SERVER['SCRIPT_NAME']?>">
  7. <input name="a" type="text" value="<?=$a?>" readonly>
  8. <input name="b" type="submit" value="+">
  9. <input name="c" type="submit" value="-">
  10. </form>
  11.  
Success #stdin #stdout 0s 82880KB
stdin
Standard input is empty
stdout
<form method="post" action="prog.php">
<input name="a" type="text" value="0" readonly>
<input name="b" type="submit" value="+">
<input name="c" type="submit" value="-">
</form>