In Last post,i have shown you how to get IP address of an user in simple manner
But it won't work in case the user is using proxy......
But still there is a way to fetch User IP even if User using a proxy .
This Will fetch Users IP (Remember it has also its own weakness )
But it won't work in case the user is using proxy......
But still there is a way to fetch User IP even if User using a proxy .
Related Post : Test
your Programming Skill : P-1
Here We Go :- <?php
- $http_cli_ip = $_SERVER['HTTP_CLIENT_IP'];
- //for checking actual internet ip rather than computer ip
- $http_ford = $_SERVER['HTTP_X_FORWARDED_FOR'];
- //this one is the next to check
- $remote_address = $_SERVER['REMOTE_ADDR'];
- //finally the computer ip
- if(!empty($http_cli_ip))
- { $ip_address = $http_cli_ip ; }
- else if(!empty($http_ford))
- { $ip_address = $http_ford; }
- else
- { $ip_address = $remote_address; }
- echo $ip_address;
- ?>
This Will fetch Users IP (Remember it has also its own weakness )
No comments:
Post a Comment
THANKS FOR UR GREAT COMMENT