title: Why is my client IP returned as ::1 on xampp?
body: <p>I am trying to get the client IP in order to compare it to some ranges, but I am failing at the first step: determining the IP address of the user.</p>
  
  <p>I use the following code:</p>
  
  <pre><code>$ip = getenv('HTTP_CLIENT_IP')?:
  getenv('HTTP_X_FORWARDED_FOR')?:
  getenv('HTTP_X_FORWARDED')?:
  getenv('HTTP_FORWARDED_FOR')?:
  getenv('HTTP_FORWARDED')?:
  getenv('REMOTE_ADDR');
  echo $ip;
  </code></pre>
  
  <p>But I get this as result: <code>::1</code></p>
  
  <p>I am using XAMPP.</p>
  
  <p>How can I get my real IP and why would XAMPP output my internal network IP and not my real IP or is there something wrong with my code?</p>