IP address range
Posted 09 March 2006 - 02:14 PM
so far this is what i have below
$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])
$q=mysql_query("SELECT * FROM users WHERE lastip='$ip'",$c);
die("Only <B>ONE</B> user per IP");
Posted 09 March 2006 - 03:23 PM
Here's 2 reasons why:
Quite a often a Lan will share an internet connection and consequently only have 1 public IP address. Your script would see this public IP address and NOT the machines private (internal LAN) IP that the machines have.
This could mean anything from 2 machines on the Lan, to 100+ machines on the lan having the same public IP address. If there were two people who wanted to legitimately sign up to your site, only one of them would be able to as you will have already added the lan's public IP to the database.
The second reason is that alot of ISP's still issue their customers with dynamic IP addresses. (this is where a persons IP address may change every time they connect to the internet).
Say person 1 signs up with his IP address then disconnects from the internet. Person 2 turns on their connection and is dynamically assigned the IP address that person 1 had before. Person 2 is now unable to sign up to your site, despite having absolutely no relation to person 1.
You see? it can cause more problems than it solves.
You are far better off using the commonly used method of taking a unique email address from your signup form, and sending a validation email to the address that is provided. It's unlikley that many people would go to the effort of obtaining a new email account just to create more than one account at a website.
Posted 10 March 2006 - 02:30 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users