[EMAIL PROTECTED] wrote:
> Hi
> 
> I wanted to get the IP address and the OS of the system when some one
> checks in the page...How will I get the IP address and OS of the
> person who visits the page(with PERL CGI)

Short answer:

   $ENV{REMOTE_ADDR} contains the client IP address
   $ENV{HTTP_USER_AGENT} might contain OS information (depends on the
client)

Long answer:

The only things you can get are:

1. The client IP address, which you can get by calling getpeername() on
STDIN (or from REMOTE_ADDR environment variable). If the client is behind a
proxy, you'd need to depend on the proxy adding something to the request
headers.

2. Information from the HTTP request headers.

If your webserver follows the CGI specification (e.g. Apache mod_cgi),
several environment variables are set from the request headers and client
connection. See http://hoohoo.ncsa.uiuc.edu/cgi/env.html

There's no information about the Client's OS, unless it's embedded in
HTTP_USER_AGENT somehow.

ALL of this can be faked except for the REMOTE_ADDR.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to