View Full Version : Getting someones IP address
Does anyone know how I can get a visitors IP address. I am writing a discussion database and want to be able to log posters ip details.
Is this a PHP thing?
Thanks
mouse
08-22-2002, 03:07 PM
This is the php:
<? $REMOTE_ADDR; ?>
in order to log it you'd need to do something like stick it in a MySQL databse.
Cheers mouse.
I am using a mysql database for this.
thanks
Another question, How would I get someones username of a site visitor, using PHP -
eg someone.aol.com? :thumbsup:
Nightfire
09-30-2002, 09:50 PM
Dunno if that's what you mean
gethostbyaddr($REMOTE_ADDR)
mordred
09-30-2002, 09:50 PM
Username? If they registered with you, don't you have already their usernames?
Originally posted by Nightfire
Dunno if that's what you mean
getenv("HTTP_X_FORWARDED_FOR")
No that just gets the IP address.
I need the username that the user connects to the internet too.
like someone.freeserve.co.uk
:confused:
Nightfire
09-30-2002, 09:58 PM
Can only get a proxy address. Look at my reply again, I must've changed it as you was replying
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.