[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-windows
Subject:    [PHP-WIN] Re: Getting my IP adress (not 127.0.0.1)
From:       24.220.56.82
Date:       2002-11-29 1:46:31
[Download RAW message or body]

 here's a simple way

<?echo "$_SERVER[REMOTE_ADDR]"?>

"Steve Yates" <steve@srtware.com> wrote in message
news:20021128073939.81023.qmail@pb1.pair.com...
> "Michael Delorme" <michael@delorme.nom.fr> wrote
> > However I only get 127.0.0.1
> > But I want the "public" dynamic adress my ISP gave me,
>
>     Don't use localhost, that's always 127.0.0.1 by definition.  You
didn't
> say what server you are using but if it's Apache try...
>
> getenv('SERVER_ADDR');
> or
> gethostbynamel(getenv('HTTP_HOST'));
>
> phpinfo() should tell you what environment variables are available for
your
> server.
>
>  - Steve Yates
>  - I have nothing against MS-DOS, stone knives, or bearskins.
>
> ~ Taglines by Taglinator - www.srtware.com ~
>
>
>



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic