PHP Conditional Script
This is a sample of a conditional PHP script where in the script identifies a number if it is zero, positive, negative or not a number at all.
Any number entered in the html form below will be identified.
<?php
IF ($_POST[number]=="0") echo "The number you entered is <b>Zero</b>";
elseif ($_POST[number] > 0)
echo "The number you entered is a <b>Positive</b> integer!";
elseif ($_POST[number] < 0)
echo "The number you entered is a <b>Negative</b> integer!";
ELSE echo "You did not enter a valid number!";
?>

0 comments:
Post a Comment