PHP: Getting outside IP address
- Posted by Kat <darkvincentdude at yahoo.com> Nov 29, 2005
- 514 views
Occasionally people have asked how to get an their externally accessable ip# when they are behind a router, or when they have a dynamic ip#. This has been working well for me for a while now, and i run it on several http hosts with no problems. It's php, not Eu. <? echo getenv("REMOTE_ADDR"); ?> Use your favorite method to http to this file.php on your remote shell, it returns your ip# that everyone sees you as, you use it. Simple. Kat <[ This message has been forwarded by Vincent on behalf of Kat. ]>