Finding true IP address using PHP


Sometimes a browser may be hiding behind a proxy, – this little function will hopefully get to the root of things:

function userIP(){
// Returns the True IP of the client calling the requested page by first checking to see if HTTP_X_FORWARDED_FOR has a value (proxy)
if($userIP == ""){
// Return the IP we've figured out:
return $userIP;

Leave a Reply

Your email address will not be published. Required fields are marked *