lama16 Posted March 9, 2006 Share Posted March 9, 2006 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");} Quote Link to comment Share on other sites More sharing options...
lessthanthree Posted March 9, 2006 Share Posted March 9, 2006 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. Quote Link to comment Share on other sites More sharing options...
lama16 Posted March 10, 2006 Author Share Posted March 10, 2006 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.