phool4fool
203.***.***.***Ban IP address from page
Simply add this to any page that you wish that you want to block that ip address from. It will echo "Site Down" to the user who's ip address is banned.This comes in helpful if you want to trick the user into thinking the site is up, but just down. Simply put <?php include 'banned.php';?> (or the name of what name your file would be in any page that you wish to block that ip.
PHP Example:
PHP code:
<?php
// Array of banned IPs, modify it to your circumstances; the IPs are just examples.
$blocked_ips = array(
'192.169.1.1',
'192.169.1.2',
'192.169.1.3'
);
foreach ($blocked_ips as $blocked_ip)
{
if ($blocked_ip == $_SERVER['REMOTE_ADDR'])
{
echo'Site Down';
exit;
}
}
?>