All pastes #397826 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-16 20:20 UTC
rendered paste body
<html>
<head>
</head>
<body>

<?php
	if(@$_POST['command']) {
		$lowerLimit = @$_POST['lower'];
		$upperLimit = @$_POST['upper'];
		$direction = @$_POST['direction'];
		$mult = @$_POST['mult'];
	}
	$error_msg=array();
	
	if(!ctype_digit($lowerLimit)) $error_msg[] = "Lower Limit is not specified, or is not all digits.";
	if(!ctype_digit($upperLimit)) $error_msg[] = "Upper Limit is not specified, or is not all digits.";
	if($lowerLimit > $upperLimit) $error_msg[] = "Lower Limit must be less than or equal to Upper Limit.";

	if($error_msg) {
		echo "<h3>Your form has the following error(s)</h3>";
		echo "<ul>\n";
		foreach($error_msg as $err) {
			echo "<li>".$err."</li>\n";
		}
		echo "</ul>\n";
		echo "<hr />";
	}
?>



<form action="/test/last.php" method="post">
    Lower Limit: <input type="text" name="lower" value="" size="6" maxlength="40"/> <br />
    Upper Limit: <input type="text" name="upper" value="" size="6" maxlength="40"/> <br />


  <input type="radio" name="direction" value="0" checked="checked">Ascending Order</input><br />
  <input type="radio" name="direction" value="1" >Descending Order</input><br />
  <input type="radio" name="direction" value="2" >Random Order</input><br />

  <br />
  <input type="checkbox" name="mult" value="yes"  >Multiply by 10.</input><br />

  <br />
  <input type="submit" name="command" value="go"/>&nbsp;&nbsp;<input type="reset" name="reset" value="reset form"/><br />
  <hr />

</form>

</body>
</html>