title: Getting Client IP Using PHP with Load Balancer (X-Forwarded-For Header)
body: <p>Here's my situation: I have a PHP website set up with <code>IIS 7</code> and an F5 load balancer. I need to retrieve the client IP address that is accessing the server. </p>
  
  <p>As expected in this scenario, <code>$_SERVER['REMOTE_ADDR']</code> returns the IP address of the load balancer, not the actual client PC. Typically, I know that <code>$_SERVER['HTTP_X_FORWARDED_FOR']</code> would be the variable that would return the actual client PC IP address, but for whatever reason, it is empty here. In other words, returning the <code>X-Forwarded-For</code> header returns nothing - what am I to do here?</p>