Re: logging ip address when submitting a form
| From: | Evan Nemerson | Date: | Fri, 28 Mar 2003 01:57:49 +0000 |
| Subject: | Re: logging ip address when submitting a form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141344@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Not true- $_SERVER['REMOTE_ADDR'] doesn't rely on anything sent by the
browser. Load up a phpinfo() on your server, then request it by hand...
echo -e "GET /phpinfo.php HTTP/1.0\r\n\r\n" | nc www.yourserver.com 80
You'll see it has your IP address even though you never supplied it. It's
pointless to send IP protocol data over HTTP. $_SERVER['REMOTE_ADDR'] is
always there, although you are right about not always being able to trust it.
On Thursday 27 March 2003 02:52 pm, Justin French wrote:
> $_SERVER['REMOTE_ADDR'] will contain the remote user's IP address IF it is
> set by the user agent (browser).
>
> It's also worth noting that this IP address could be faked, could be
> rotated by their ISP on a request-by-request basis (eg all AOL users),
> could be that of their firewall or network gateway, etc etc.
>
> It's fine to log it, but don't rely on it for future visits, or anything
> like that :)
>
>
> Justin
>
> on 28/03/03 5:04 AM, Joakim Larsson (joakimpl@kth.se) wrote:
> > Hello,
> >
> > Is there a command in php that would logg the ip address of the user
> > viewing the php file.
> > I need someway of finding out who posted the form.
> >
> > thanx
- --
The greatest mistake is to imagine that the human being is an autonomous
individual. The secret freedom which you can supposedly enjoy under a
despotic government is nonsense, because your thoughts are never entirely
your own. Philosophers, writers, artists, even scientists, not only need
encouragement and an audience, they need constant stimulation from other
people. It is almost impossible to think without talking. If Defoe had really
lived on a desert island, he could not have written Robinson Crusoe, nor
would he have wanted to. Take away freedom of speech, and the creative
faculties dry up.
- -George Orwell
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE+g6wm/rncFku1MdIRArjPAJ46kEGkzIeZCSGiEMQEJ5d7SZd/RQCfaVgH
LfbocrxUHMpgbcLL4boIxI8=
=RG1G
-----END PGP SIGNATURE-----