$REMOTE_ADDR
On Wed, 2 Oct 2002, Webmaster MBTRADINGCO wrote:
I'm sure there has to be a way to verify which IP address is accessing
from. I need to establish a page where when I enter it records the IP
address I'm logging in from, to a database.
Problem is I can't seem a command in php
Try: $ip=$_SERVER['REMOTE_ADDR']
-Original Message-
From: Webmaster MBTRADINGCO [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 02, 2002 1:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting users IP address into a variable.
I'm sure there has to be a way to verify which IP address
Hi,
I'm sure there has to be a way to verify which IP
address is accessing from.
$ip=HTP_GET_
$REMOTE_ADDR
...and to deal with some (but not all) proxies:
$ip = (getenv(HTTP_X_FORWARDED_FOR))
? getenv(HTTP_X_FORWARDED_FOR)
: getenv(REMOTE_ADDR);
Either way you're
Try:
$ip = ;
if ( $HTTP_X_FORWARDED_FOR ) {
$ip = $HTTP_X_FORWARDED_FOR;
} elseif( $HTTP_VIA ) {
$ip = $HTTP_VIA;
} elseif( $REMOTE_ADDR ) {
$ip = $REMOTE_ADDR;
} else {
die(); // or perhaps some better response
}
--- Webmaster MBTRADINGCO [EMAIL PROTECTED]
wrote:
Webmaster MBTRADINGCO wrote:
I'm sure there has to be a way to verify which IP address is accessing
Don't count on it to identify users on the internet though.
Regards
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
is the current IP address for it's server.
Thanks to all it worked.
-Mensaje original-
De: Jon Haworth [mailto:[EMAIL PROTECTED]]
Enviado el: MiƩrcoles, 02 de Octubre de 2002 10:19 a.m.
Para: [EMAIL PROTECTED]
Asunto: RE: [PHP] Getting users IP address into a variable.
Hi,
I'm sure
6 matches
Mail list logo