Get Visitors IP Address


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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. }

URL: http://www.devirtuoso.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.