Following from my last post, here is the method to get your IP address if you are behind a proxy.

  1. function getRealIPAddr() {
  2.     if (!empty($_SERVER[‘HTTP_CLIENT_IP’]))   //check ip from share internet
  3.     {
  4.         $ip=$_SERVER[‘HTTP_CLIENT_IP’];
  5.     }
  6.     elseif (!empty($_SERVER[‘HTTP_X_FORWARDED_FOR’]))   //to check ip is pass from proxy
  7.     {
  8.         $ip=$_SERVER[‘HTTP_X_FORWARDED_FOR’];
  9.     }
  10.     else
  11.     {
  12.         $ip=$_SERVER[‘REMOTE_ADDR’];
  13.     }
  14.     return $ip;
  15. }

As this method gets more accurate results it is better to use this than the previous function.