Link to home
Start Free TrialLog in
Avatar of Arnnie
Arnnie

asked on

Trying to determine IP provided by ISP

Hi Friends,

Does anybody have a PHP script which can return the external IP provided by the ISP?  The purpose is rather convoluted, however I'am trying to manage these dynamically allocated IP's.

My Web server is located behind a router or a proxy.

How do I get this IP when called within the Local network?

Thanks
Arnnie
Avatar of AhmadKhatib
AhmadKhatib

<?
//Get users IP Address
$ipaddress = ($HTTP_SERVER_VARS["REMOTE_ADDR"]);
?>
yeah he is right....

$ip=getenv("REMOTE_ADDR");

regards


I would recommend the new way since the old way will be deprecated...

$ipaddr=$_SERVER['REMOTE_ADDR'];
ASKER CERTIFIED SOLUTION
Avatar of birdgenj
birdgenj

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Arnnie

ASKER

Thanks for the advice.

The solution you've mentioned is what I suspected.  I just wanted to avoid third party webservers for redundancy purposes.

Thanks again.