rendered paste body<html>
<head>
</head>
<body>
<?php
$size = "3";
$submit = isset($_POST['command']);
if(submit) {
$size = $_POST['size'];
if($size == "" || !ctype_digit($size) || $size > 12 || $size < 1) {print "size must be an integer between 1 and 12 (inclusive)"; }
else {
//page#2
echo '<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
<input type="hidden" name="step" value="2" />
<input type="hidden" name="size" value="3" />';
echo '<select name="v0">';
for($i=0; i < sizeof($size); ++$i) {
echo '<option value="'.$i.'">unset</option>';
}
echo '</select>';
echo '<input type="submit" name="command" value="go"/><br />
</form>';
}
}
//page#1
echo '<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
<input type="hidden" name="step" value="1" />
Size: <input type="text" name="size" value="'.$size.'" size="6" maxlength="40"/>
<input type="submit" name="command" value="go"/><br />
</form>';
//page#3
echo '<h1>And the answer is... 6</h1>';
?>
</body>
</html>