Re: URGENT - owa_util.get_cgi_env('REMOTE_ADDR')
Date: Wed, 9 Oct 2002 18:26:59 +0200
Message-ID: <ao1lb6$lmb12_at_ns4.bih.net.ba>
Finn Ellebaek Nielsen <fen_at_changegroup.dk> wrote in message
news:3da29efe$0$18699$edfadb0f_at_dspool01.news.tele.dk...
> Hi there.
>
> How are you calling the stored procedure from your form? Directly from
> PL/SQL? Then the stored procedure is invoked directly, not involving iAS,
> thus not setting up the PL/SQL Web Toolkit with CGI variable values, etc.
If
> from PL/SQL using a URL this will probably be executed on the iAS, not on
> the client. So you need some mechanism of obtaining the client's IP
address,
> probably through some Java code running in the form on the client. You can
> specialize the look and feel of the form so I guess you can inject other
> Java code as well.
This is simple solution for me, but it doesn't work. I found this solution on http://metalink.oracle.com. I am not a java programer so I need solution like this.
Copy/Paste
Here are the steps to complete:
- Change the template HTML file to include the following: <PARAM NAME="serverArgs" VALUE="Module=%Module% IP=%IP%& quot;> and serverArgs="Module=%Module% IP=%IP%"
- Create a database stored procedure:
CREATE OR REPLACE PROCEDURE GetIPAddress AS
IP_Address VARCHAR2(40);
BEGIN
owa_util.mime_header('text/html',FALSE); htp.htmlopen; ip_address:=owa_util.get_cgi_env('REMOTE_ADDR'); htp.bodyopen; owa_util.redirect_url('http://<hostname>.<domain>:<port> /servlet/f60servlet? form=test.fmx'||'&'||'IP='||IP_Address,true); htp.bodyclose; htp.htmlclose;
END; Note: Be sure to change the owa_util.redirect_url to include the URL that calls
WebForms.
3. Change the Forms module to accept the IP as a parameter.
- Open the Form
- in the Object Navigator select the PARAMETERS node
- create a parameter called IP 4. Use this new parameter in the Form.
In this example, to display it as a message, add the following in the WHEN_NEW_FORM_INSTANCE trigger:
message('Client IP address is: '||:PARAMETER.IP);
5. Test WebForms by calling the new stored procedure:
"http://<hostname>.<domain>:<port>/pls/<DAD> /GetIPAddress"
I try this but you know... Received on Wed Oct 09 2002 - 18:26:59 CEST