Re: logging ip address when submitting a form
| From: | Evan Nemerson | Date: | Thu, 27 Mar 2003 18:27:39 +0000 |
| Subject: | Re: logging ip address when submitting a form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141279@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You might wanna move ipaddr.log outside your server root... or at least use
some .htaccess... wouldn't want someone to just browse to the file...
$fp = fopen("ipaddr.log", "a+");
fputs($fp, $_SERVER['REMOTE_ADDR']."\n");
fclose($fp);
On Thursday 27 March 2003 10:04 am, Joakim Larsson 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
- --
Cats are intended to teach us that not everything in nature has a function.
- -Garrison Keillor
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE+g0Kk/rncFku1MdIRAv9gAKCsYSQ6SVXitFxAOBnbYap3/15VmgCgjwYz
41qDV2J1Ba647Nt74z4SOYY=
=7017
-----END PGP SIGNATURE-----