• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Ban people on website!

Aeron

www.Asgard-World.com
Joined
Jul 23, 2009
Messages
231
Reaction score
3
Location
Spain
A simple script. It restricts the access to your website.

PHP:
<?php
$ip = getenv('REMOTE_ADDR');
$blocked = "xx.xx.xx.xx"; // Replace the x's with the IP address.

if (ereg($blocked,$ip))
{
echo "You Have Been Banned. You cannot enter to website.";
exit();
}
?>
 
Oh! I Forget to say this must be inserted in layout.php
 
Little edited version:
Code:
<?PHP
	$ip = array("localhost", "noobhost", "123.456.78.90");
	if in_array($_SERVER['REMOTE_ADDR'], $ip)
		die("403 - Forbidden");
?>
 
Back
Top