blocking an ip address

Soldato
Joined
6 Mar 2008
Posts
10,085
Location
Stoke area
Hi,

We have a problem member on our site that just keeps making new accounts but using the same IP address.

Is there anyway we can block that IP by editing a file on the server? and if so, which file and how?
 
I'd have thought most forums would have an IP address blocking section. Or if you have cPanel on your account try the 'IP Deny Manager' section (I've never used it, but it sounds promising).
 
As said, if it's a forum then you should have the option to ban based on IP. Likewise you have the option to block an IP on control panels like cPanel or Plesk.
Alternatively you can create a .htaccess file in the root and deny an ip access -
Code:
order allow,deny
deny from <ip_here>
allow from all
 
although .htaccess probably is a better method, another alternative is to use a line of server code, here is a php example:

PHP:
<?php
$banned[0]="127.0.0.1"; // Set IP Address
$banned[1]="127.0.0.2"; // adding another ip address
// can add as many as you want

if (in_array($_SERVER['REMOTE_ADDR'],$banned)) header("HTTP/1.1 403 Forbidden");
?>

Every page that you require restricted accesss will need to have this code added/included to it.
 
Alternately modify your chat script so that banned users can send messages but they never get delivered to anyone, let them waste their time ;).
 
Back
Top Bottom