Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Return the Client Ip

Quote Reply
Return the Client Ip
Is there an easy way to return a client's IP address to the login screen (this is for phone support issues that arise). I tried creating a simple perl script to return the envoronment variable $REMOTE_ADDR but not much luck. Is there an easier way?

sub ClientIP {
#--------------------------------------------------------------------
# Return the client IP.
#
return $ENV{$REMOTE_ADDR};
}

Also is there any products updates that I need to keep up with? like the DBSql code or even the GT libraries? I currently have "Revision : $Id: db.cgi,v 1.19 2001/04/25 00:55:23 alex Exp $" Which is just db.cgi but it gives you the idea of how long it has been since it has been updated.
Quote Reply
Re: [LanceWilson2] Return the Client Ip In reply to
Hi,

I've tested the following global called "ClientIP":

Code:

sub {
my $client = $ENV{REMOTE_HOST} || $ENV{REMOTE_ADDR};
return $client;
}


In my login.html template, I've used <%ClientIP%> to display the client info. Everything seems to work fine on my system. I don't know why your code didn't work (should have worked, too). I have the same db.cgi revision, but it could be that I have other modules or libraries than you.

Cheers,
Oliver
Quote Reply
Re: [LanceWilson2] Return the Client Ip In reply to
Hi,

Change it to :
return $ENV{REMOTE_ADDR}; # without $
and it should work.

Cheers,
Gossamer Threads Inc.