PDA

View Full Version : Getting someones IP address


kjc
08-22-2002, 03:02 PM
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.

kjc
08-22-2002, 03:39 PM
Cheers mouse.
I am using a mysql database for this.
thanks

kjc
09-30-2002, 09:05 PM
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?

kjc
09-30-2002, 09:55 PM
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