- 
      
- 
        Save codehead/5170666d0755d5bd3312 to your computer and use it in GitHub Desktop. 
Revisions
- 
        codehead revised this gist Apr 27, 2015 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,8 @@ // Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address if($_SERVER['REMOTE_ADDR']=="10.1.1.1") { // Known reverse proxy if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { // Known header $http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] ); $_SERVER['REMOTE_ADDR'] = $http_x_headers[0]; } } 
- 
        ryanjbonnell created this gist Mar 12, 2014 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ // Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { $http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] ); $_SERVER['REMOTE_ADDR'] = $http_x_headers[0]; }