Multiple IF and ELSE statements
Posted: Wed May 21, 2003 10:00 am
Howdy, I've been working on my website for the past few days and everything is going good so far. Im going to be using a PHPbb forum, and i'm sure eventually someone is going to be a lamer, so im using a script on my page so if they break some rules, i can ban them from viewing the entire site. But, when i try adding multiple IP's to the ban list, it kinda displays multiple messages.. Heres what i have:
And i hope its in a readable format, if it's not, i would appreciate if you give me an example on how i should space parts out, and what parts should/shouldn't be spaced. Thanks
Code: Select all
<?php
if($_SERVER["REMOTE_ADDR"] == '111.111.11.111') {
echo "Your IP is banned!";
} else {
echo "Welcome!";
}
if($_SERVER["REMOTE_ADDR"] == '222.222.22.222') {
echo "Your IP is banned!";
} else {
echo "Welcome!";
}
?>