[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 IDEAS

Thanks


Elliot J. Balanza



-- 
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 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 that can assign that to a
 variable, as in:

 $ip=HTTP_GET_

 ANY IDEAS

 Thanks


 Elliot J. Balanza



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
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 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 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 IDEAS

Thanks


Elliot J. Balanza



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
**
Any views, opinions or authorizations contained in this email are solely those of the 
author and do not necessarily represent those of ArvinMeritor, Inc. If you are not 
familiar with the corporate authority of the author, please obtain confirmation in 
writing 
of the content of this email prior to taking any action on the basis of the 
information. If 
you are not the intended recipient, you are hereby notified that any disclosure, 
copying 
or distribution of the information enclosed is strictly prohibited. 
**


-- 
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 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 still going to get stuff that isn't right, so make sure
(a) you validate the contents of $ip before doing anything with it, and (b)
you're not using it for anything critical.

Cheers
Jon

-- 
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 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:
 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 IDEAS
 
 Thanks
 
 
 Elliot J. Balanza
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-- 
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 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

Actually I'm just using it so a customer can acces a PWS that is
broadcasting on its own security cameras. I have a DSL that disconnects
every 8 hours, and gives dinamyc IP, so each time it connects it goes to
my site, and writes down the addres, so my customer can access the
report, and see what 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 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 still going to get stuff that isn't right, so make
sure
(a) you validate the contents of $ip before doing anything with it, and
(b)
you're not using it for anything critical.

Cheers
Jon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php