Re: Wrong IP address
| From: | Chris Shiflett | Date: | Tue, 30 Mar 2004 02:36:27 +0000 |
| Subject: | Re: Wrong IP address | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181768@lists.php.net to get a copy of this message | ||
--- ascll <ascll@yahoo.com> wrote:
> <?php
> echo($_SERVER["REMOTE_ADDR"]);
> ?>
>
> to get the web IP address for my machine once my PC is connected to
> Internet..
>
> Anyway, sometime I get the correct IP address, but sometime NOT.
You're going to have to explain why you think one is right and one is
wrong. I can tell you that $_SERVER['REMOTE_ADDR'] always has the
"correct" IP of where the HTTP request originated.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/