Gossamer Forum
Home : Products : DBMan : Installation :

$ENV{'REMOTE_HOST'}

Quote Reply
$ENV{'REMOTE_HOST'}
Hello all,

I will print the host address (something like myisp.com) in my log file and not 195.212.141.247. What can I do to get the real entry from DNS and not the IP number?

Thanks
Rene
Quote Reply
Re: $ENV{'REMOTE_HOST'} In reply to
Hi Jaime

Thanks for your replay, but HTTP_REFERER returns my own domain name and what I search for is the domain name of the user that has logged in to my database.

Rene
Quote Reply
Re: $ENV{'REMOTE_HOST'} In reply to
Hi Rene

Have you tried using the global variable $ENV{'HTTP_REFERER'}. I believe this variable might give you the URL from where the user came from.

Cheers
-JO
Quote Reply
Re: $ENV{'REMOTE_HOST'} In reply to
I found an example that works on a Windows NT server but not on a UNIX server. Can anyone tell me wy this not work?

if ($ENV{'REMOTE_HOST'} eq $ENV{'REMOTE_ADDR'})
{
$Address = pack('C4', $1, $2, $3, $4);
$DNS_Address = (gethostbyaddr($Address, 2))[0];
$ENV{'REMOTE_HOST'} = $DNS_Address if $DNS_Address;
}