Re: Oracle Portal: Get visitor IP Address

From: Bricklen <bricklen-rem_at_yahoo.comz>
Date: Tue, 06 Apr 2004 19:10:47 GMT
Message-ID: <XgDcc.7592$Sh4.2300_at_edtnps84>


Tiago Rocha wrote:

> Hi!
>
> I have developed a nice portal for a health insurance company and now big boss wants to record the
> IP of the people who are visiting the website, he wants to do more or less what those counters do
> (the one I remember is thecounter.com, but there are others.), so he can decide where he should
> concentrate on advertising...
>
> I searched at asktom.oracle.com and found some examples and I came to this:
>
> Insert into the_log_table ( ip#, dt_visita )
> Select sys_context( 'userenv', 'ip_address' ),
> SysDate
> from dual ;
>
> As you see, I'm using sys_context, but it gets the IP of the machine which is conected to the
> database, and it's always the internal IP of the web server. 192.***** This code is right at the
> main "portlet", in a way that it's impossible to have access to the website without going through
> that insert.
>
> Is there any way, any package, something that I can use to get the IP address of the visitor of the
> page?
>
> portal version is 3.0.9.8.5 (latest patch level for portal v1), DB is 8.1.7.4 and Apache is under
> SuSe 7.3
>
> Thanks in Advance and forgive my bad english!
>

If you can use perl or javascript, you could try perl: $ENV{'REMOTE_ADDR'}
or javascript: http://javascript.internet.com/user-details/ip.html

Not sure about pl/sql though. Received on Tue Apr 06 2004 - 21:10:47 CEST

Original text of this message