ramble
asked on
Your IP address is: xxx.xxx.xxx.xxx
When a user accesses the web page, how do I display the IP address they are coming from. I'd like to do this with the CGI.pm PERL module. (and store it in a variable)
TIA
TIA
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
use the print $query->http($string) where $string is any of the http enviroment variables listet on the page in the previous comment. So replace the REMOTE_ADDR with REMOTE_HOST and you'll get the hostname, if that is what you ment with your question?
/Linus
/Linus
ASKER
I never tried the ->ADDR string, so, interesting enough, I'm still only receiving the numerical IP address. (with the remote_host). But, perhaps it's just not resolving correctly with my "test machine". Thanks
ASKER
Thanks, Points awarded. However, if it's quick...what if you'd want to get the hostname...example, if the IP address resoved to: some.domains.com. And you wanted that stored in the variable instead of the IP.
Thanks_ramble