Posted By

sandrews_06 on 09/03/10


Tagged

php ip


Versions (?)

Get Visitors IP Address


 / Published in: PHP
 

URL: http://www.devirtuoso.com

  1. function visitorIP()
  2. {
  3. if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){
  4. $TheIp=$_SERVER['HTTP_X_FORWARDED_FOR'];
  5. }else{
  6. $TheIp=$_SERVER['REMOTE_ADDR'];
  7. }
  8.  
  9. return trim($TheIp);
  10. }

Report this snippet  

You need to login to post a comment.