| | |
how to detect the username sharing by IP address?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
•
•
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?
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.
![]() |
Similar Threads
- resultset updatable (Oracle)
- username=email address inputted on submission>is this possible (PHP)
- Problem with filesharing on XP home (Windows NT / 2000 / XP)
- Postfix configuration (*nix Software)
- Stuck on Mail() Function (PHP)
- ftp client issues...im so confused...plz help!!! (Windows Software)
Other Threads in the PHP Forum
- Previous Thread: $rs=mysql_query($sql) or die("error in common.inc.php at line 257");
- Next Thread: Need help with existing code
Views: 3119 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery js limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube





