RE: [PHP] getting ip address of the user.

2002-09-24 Thread Mark Charette

This comes up so very often ...

The answer is - you may be able to get _an_ IP number for a machine that
accesssed your site. It is meaningless as a means of identification:

Proxies use 1 IP for a number of users.

-Original Message-
From: Anil Garg [mailto:[EMAIL PROTECTED]]

hi,

Can i get the ip-address of the machines who accessed my website??
Plz give the pointer that on what lines shall i start for doing so.


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




Re: [PHP] getting ip address of the user.

2002-09-24 Thread Bill Farrell

Hi, Tony...
Here's a script I pilfered from online a coupla years
back and have modified (over and over).  The code
would be online, except my ISP is having heartburns
lately...
Bill


WhoAmI Utility


This utility can help you identify your browser and
your
Internet provider.  It uses all of the worldwide NIC
authorities to obtain only public information.
No
information obtained by this page is ever
retained...it
is simply a diagnostic to help web programmers
understand
how web servers respond to information provided by
their
browsers.  It is provided in an effort to help web
programmers
isolate browser differences so that their programming
will
be more sure to work on more platforms.


The Basics


Your host name is $host\n";
}

print "Your IP Address is $ip\n";
print "Your web service provider was found in
$RespondingAuthority\n";
print "Your browser is reported as $Agent\n";

if ( isset( $SendTo ) ) {
list( $EmailAddress, $Provider ) = explode( "@",
$SendTo );
print "Your service provider is
$Provider\n";
}
print "\n";

print "The Entire Response from
$RespondingAuthority\n";
print "\n";
foreach ( $WholeResponse as $Line ) {
print "$Line\n";
}
print "\n";

print "Your browser sent the following
headers\n";
print "\n";
foreach( $HeaderLog as $Line ) {
print "$Line\n";
}
?>




Show me the code
for this page.




=
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 ip address of the user.

2002-09-24 Thread Bill Farrell

Hi, Y'all,
Here's another suggestion FWIW.  I prep a few
variables in the htmlhead.php routine, $RemoteHost
being one of them.  Having some simple names for
associated values is kinda handy.  One of the biggest
strengths of PHP is that there's more than one way to
go about solving problems.  Here goes:




--- Jesse Cablek <[EMAIL PROTECTED]> wrote:
> Anil Garg  scribbled;
> > 
> > Can i get the ip-address of the machines who
> accessed my website??
> > Plz give the pointer that on what lines shall i
> start for doing so.
> > 
> 
> print $_SERVER['REMOTE_ADDR'];
> 
> -jesse
> 
> 
> -- 
> 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 ip address of the user.

2002-09-24 Thread Jesse Cablek

Anil Garg  scribbled;
> 
> Can i get the ip-address of the machines who accessed my website??
> Plz give the pointer that on what lines shall i start for doing so.
> 

print $_SERVER['REMOTE_ADDR'];

-jesse


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