Jump to content


Photo

IP address range


  • Please log in to reply
2 replies to this topic

#1 lama16

lama16
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 09 March 2006 - 02:14 PM

hi what i want to do is when a user registers it checks the ip address to see if it is already in the database and if it is it would refuse the user..... the problem is if the user are on a LAN so he could register on one computer then move to the nxt and register again creating lots of users. so what i want to do is to stop users registering on a LAN only to restrict it to one user.

so far this is what i have below


$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])
? $_SERVER['HTTP_X_FORWARDED_FOR']
: $_SERVER['REMOTE_ADDR'];
$q=mysql_query("SELECT * FROM users WHERE lastip='$ip'",$c);
if(mysql_num_rows($q))
{
die("Only <B>ONE</B> user per IP");
}




#2 lessthanthree

lessthanthree
  • Members
  • PipPipPip
  • Advanced Member
  • 85 posts
  • LocationUK

Posted 09 March 2006 - 03:23 PM

It's possible but it's not a particulalrly good idea.

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.



call me a safe bet, i'm betting i'm not

#3 lama16

lama16
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 10 March 2006 - 02:30 AM

i've been looking for a script for email validation to check if the email is vaild also to send an email validation to validate that account. any help? also how would the account be activated via email?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users