voodish logo
tweet rss book of faces Linked In

Display real IP, even behind a Proxy

php

To find the real IP of an inbound connection, even if it is using a Proxy service, then use the following code snippet in your PHP file.

Make sure to CHOWN the file to apache if you experience any problems with output.

$ip = isset($_SERVER[’HTTP_X_FORWARDED_FOR’]) ? $_SERVER[’HTTP_X_FORWARDED_FOR’] : $_SERVER[’REMOTE_ADDR’];
echo ‘Your IP is: ‘.$ip;

Related Articles

Comments RSS Feed

2 Comments

  1. SEO India January 12, 2012

    I don’t think finding a real ip behind anonymous ip is possible until the proxy server co-operates you.

  2. Go to Top of the page

  3. SEO India January 12, 2012

    Yes, it’s not possible.

  4. Go to Top of the page

Leave a comment