Getting A Visitor's Ip Address Using Perl

liunx

Guest
I have a PERL script where I'd like to get the visitor's IP address. How do I do that in PERL?<br /><br />I realize that proxies mean that I might not be getting their <b>true</b> 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.<br /><br />Thanks for any ideas,<br />Steve<!--content-->
Try $ENV{REMOTE_HOST} or $ENV{REMOTE_ADDR}<!--content-->
<!--quoteo(post=208618:date=Jun 29 2007, 11:43 PM:name=carbonize)--><div class='quotetop'>QUOTE(carbonize @ Jun 29 2007, 11:43 PM) <a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=208618"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><div class='quotemain'><!--quotec-->Try $ENV{REMOTE_HOST} or $ENV{REMOTE_ADDR}<!--QuoteEnd--></div><!--QuoteEEnd--><br />REMOTE_ADDR worked and showed my IP address, but REMOTE_HOST didn't show my host name. <a href="http://ipchicken.com" target="_blank">IP Chicken</a> does show my host name. It's not a big deal, though.<br /><br />Thanks for the information,<br />Steve<!--content-->
 
Top