Page 1 of 1

How can I get the user's IP

Posted: Fri Jun 13, 2003 7:03 pm
by GregArtemides
I'm looking for a way to get the ip address of users logging into my site, for security purposes. Is there a function in PHP that would do this? Does anyone have a script that would do this? I basically want to make sure that I know where a user is registering from, as a way of monitoring anauthorized users trying to sneek in. Any ideas? :?:

Posted: Fri Jun 13, 2003 7:10 pm
by volka
take a look at the members of $_SERVER at http://php.net/reserved.variables

Posted: Fri Jun 13, 2003 7:10 pm
by cactus
See the bottom of this thread:

viewtopic.php?t=9560

Regards,

Volka: Jinx :)

Posted: Sat Jun 14, 2003 3:15 am
by delorian
If you need the IP address for security purposes I also recomend reading about HTTP_X_FORWARDED_FOR - it's a reserved variable for you real IP when someone is connecting through a proxy server. Then the REMOTE_ADDR will have the proxy's IP and HTTP_X_.... will have the "real" user. Read the PHP manual page which volka gave you and especially the user notes at the bottom.