Jump to content

Recommended Posts

Posted

I have a PERL script where I'd like to get the visitor's IP address. How do I do that in PERL?

 

I realize that proxies mean that I might not be getting their true IP address, but I don't much care about that. If you can get both the external and true IP addresses, that would be best, but not required.

 

Thanks for any ideas,

Steve

Posted
Try $ENV{REMOTE_HOST} or $ENV{REMOTE_ADDR}

REMOTE_ADDR worked and showed my IP address, but REMOTE_HOST didn't show my host name. IP Chicken does show my host name. It's not a big deal, though.

 

Thanks for the information,

Steve

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...