[PHP] Getting users IP address into a variable.

2002-10-02 Thread Webmaster MBTRADINGCO
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 that can assign that to a variable, as in: $ip=HTTP_GET_ ANY

Re: [PHP] Getting users IP address into a variable.

2002-10-02 Thread Rasmus Lerdorf
$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

RE: [PHP] Getting users IP address into a variable.

2002-10-02 Thread Merritt, Dave
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

RE: [PHP] Getting users IP address into a variable.

2002-10-02 Thread Jon Haworth
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

Re: [PHP] Getting users IP address into a variable.

2002-10-02 Thread Bill Farrell
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:

Re: [PHP] Getting users IP address into a variable.

2002-10-02 Thread Chris Hewitt
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

RE: [PHP] Getting users IP address into a variable.

2002-10-02 Thread Webmaster MBTRADINGCO
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