You’ll most likely want to use IF with ELSE.
ELSE gives you the option of doing something ELSE with your PHP script if IF doesn’t calculate one way or another.
For example, you can have your site display something IF a condition is met (like a password was correct...see below!) or something ELSE if not. (Like a redirect if the password is not!)
Code example...
<?php
$five = “5”;
if ($five == “5”) {
echo "You are correct";
} else {
echo "You are incorrect";
}
?>
0 Comments
Leave a Reply. |
David Rentson
If this free PHP and MYSQL Tutorial is helpful for you... Great! Archives
October 2008
Categories
All
|