Log in

View Full Version : IP ban question



auriaks
02-17-2010, 04:23 PM
Hi,

Im using IP block for double users script which looks like this:



<?php
include $_SERVER['DOCUMENT_ROOT'] . '/content/processes/db_conn.php'; //db
$userIP = $_SERVER['REMOTE_ADDR'];
$IP_check3 = mysql_query("SELECT * FROM reg_users WHERE IP='$user_IP'");
if(mysql_num_rows($IP_check) > 0) {exit("Only one user with One IP");} else {*register form*}
?>


Also I have row with IP saved from register page...

Will this script work without issues?? Because I know about Ip changers and other malware :D

Share your opinion... :)

traq
02-17-2010, 04:27 PM
it may work, but not always as intended. Shared or dynamic IPs, for instance: you may end up blocking legitimate users.

auriaks
02-17-2010, 04:36 PM
As example: I have 3 IP's I think... I dont how it happens, but they are changing automatically.

Queops
02-17-2010, 06:05 PM
Try actually storing Useragent data (comes with OS info), as an extra help.

djr33
02-17-2010, 06:25 PM
Useragent data will vary based on OS and browser, so users with two computers or just two browsers won't be effectively banned.


Banning based on IP is unreliable over a long time, but for just a month or so fairly reliable. You can lift the ban after a month and hope the user has given up by then. At worst, you'll have to reban them after a month. Spammers aren't usually that persistent.

auriaks
02-17-2010, 06:32 PM
:) thanks for that