- Joined
- Feb 5, 2010
- Messages
- 149
- Reaction score
- 19
some people have no idea how to ban from a site
this script is a very simple lockout function to block
the ip you have put into this script from seeing your site
for this script to work and not slow down your site
save this code as ipbanned.php and put a copy in every folder in your www folder then
type in
at the very top of every .php file you have in your www folder
this will result in a message like this
for this example i used 127.0.0.1 to ban my local host
replace the 0.0.0.0 with the ip of the person you would like to ban
to ban fully from your network access your firewall setting and to blocked ips (could be named something else or hard to find) and add that persons ip and they cannot log in game either
this script is a very simple lockout function to block
the ip you have put into this script from seeing your site
PHP:
<center>
<?PHP
$ban_ips = ("0.0.0.0,0.0.0.0"); //First ip goes before the comma, second goes after the comma.
$visitor_ip = $_SERVER['REMOTE_ADDR'];
$ip_list = explode(",", $ban_ips);
foreach($ip_list as $ip)
{
if($visitor_ip == $ip)
{
die("You Have Been Banned From This Network. Have A Nice Day. :]");
}}
?>
</center>
for this script to work and not slow down your site
save this code as ipbanned.php and put a copy in every folder in your www folder then
type in
PHP:
<?PHP
include('ipbanned.php');
?>
at the very top of every .php file you have in your www folder
this will result in a message like this
for this example i used 127.0.0.1 to ban my local host
replace the 0.0.0.0 with the ip of the person you would like to ban
to ban fully from your network access your firewall setting and to blocked ips (could be named something else or hard to find) and add that persons ip and they cannot log in game either

