This was the follow up tutorial...slighty more plump but pretty much the same.
---
Someone causing you pain?
BAN THEM! Code:
<?php
$ip=getenv('REMOTE_ADDR');
$banned=xxx.xxx.xxx.xxx;
if (ereg($banned,$ip)) {
echo 'Sorry...but you've been BANNED!';
exit();
}
?> -- That's the full code...but what's the use of it without an explination?
<?php
This opens the php script.
$ip=getenv('REMOTE_ADDR');
This gets the visitor's IP address.
$banned=xxx.xxx.xxx.xxx;
Replace "xxx.xxx.xxx.xxx" with the IP of the banned user.
if (ereg($banned,$ip)) {
This see's if the visitor's IP and the Banned IP match.
If they do match the visitor will recieve a message:
echo 'Sorry...but you've been BANNED!';
And the page wont load. (Feel free to change the message).
exit();
}
?>
Just closing the script.
---
No more trouble!