Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php header x forwarder for

public function getClientIP(){       
     if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)){
            return  $_SERVER["HTTP_X_FORWARDED_FOR"];  
     }else if (array_key_exists('REMOTE_ADDR', $_SERVER)) { 
            return $_SERVER["REMOTE_ADDR"]; 
     }else if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {
            return $_SERVER["HTTP_CLIENT_IP"]; 
     } 

     return '';
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #header #forwarder
ADD COMMENT
Topic
Name
2+5 =