how to detect the username sharing by IP address?

Reply

Join Date: Jun 2005
Posts: 92
Reputation: michael123 is an unknown quantity at this point 
Solved Threads: 0
michael123 michael123 is offline Offline
Junior Poster in Training

how to detect the username sharing by IP address?

 
0
  #1
Jun 17th, 2005
I have a login script, I want to modify it to restrict the sharing username access, by IP address, what will be a good method to do this?

thanks.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 354
Reputation: Troy is an unknown quantity at this point 
Solved Threads: 5
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

Re: how to detect the username sharing by IP address?

 
0
  #2
Jun 17th, 2005
Originally Posted by michael123
I have a login script, I want to modify it to restrict the sharing username access, by IP address, what will be a good method to do this?
What I think I hear you say is you want to be able to detect if more than one IP address logs in with the same username? You want to use this to detect account sharing? Please clarify.

Detecting the IP address is very easy, create a PHP page with only this code in it:
[PHP]
<php
phpinfo();
?>
[/PHP]
Run the page in a browser, then look for the server variables such as "REMOTE_ADDR". In PHP, you access these using the $_SERVER object.
[PHP]
$ip = $_SERVER['REMOTE_ADDR'];
[/PHP]

I should add that this is not a good way to detect account sharing unless you want to make it clear to your users that they can only use their account on a single computer and if the cable/dsl company changes their dynamic IP, they will lose access to their account.

I should also point out that the opposite is true, one IP could be hundreds of people. Almost any company on the Internet has all of its employees surfing the web behind a single IP--the IP of their firewall or router. In the old days, IP used to equate to unique identity on the Internet. That is no longer true.
Troy Wolf is the author of SnippetEdit. "Website editing as easy as it gets." IX Web Hosting
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 3119 | Replies: 1
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC