Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Meta Redirects and CGI

by Parham (Friar)
on Jan 27, 2002 at 19:35 UTC ( #141938=note: print w/replies, xml ) Need Help??

in reply to Meta Redirects and CGI

to answer your question, if you want to grab the ip of a user, look at $ENV{'REMOTE_ADDR'}. I'll take it a step further, if you want to change that IP into an address (or if $ENV{'REMOTE_HOST'} doesn't exist), try this:
$ip = $ENV{'REMOTE_ADDR'}; @digits = split (/\./, $ip); $address = pack ("C4", @digits); $host = gethostbyaddr ($address, 2);
other environmental variables you might find useful:

$ENV{'HTTP_REFERER'} will contain where the user came from (a url)

$ENV{'HTTP_USER_AGENT'} contains browser information of the user

$ENV{'REQUEST_METHOD'} contains the request method (post, get) $ENV{'QUERY_STRING'} is what the query string was, everything after the '?' in the url

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://141938]
[hippo]: Trolls are trolls.
[Eily]: Discipulus sadly the CSS solution to ignore him isn't very effective when he answers the thread you want to read ...
[Eily]: (or in your case answers directly to you)

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2017-11-24 10:56 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (347 votes). Check out past polls.