Using OWA_UTIL.GET_CGI_ENV

Oracle 10G Enterprise edition
Hi All,
I tried to use owa_util.get_cgi_env('HTTP_REFERER') to get the current URL, but it returned the previous URL of my webpage. Is there any other parameters to pass to owa_util.get_cgi_env() to get the current URL.
Thanks
R

Not sure if there's a single variable, but you can always use
'http://' || owa_util.get_cgi_env('http_host')
                || '/'
                || owa_util.get_cgi_env('script_name')
                || '/'
                || owa_util.get_cgi_env('path_info')
                || '/'
                || owa_util.get_cgi_env('query_string')

Similar Messages

  • Using owa_util.get_cgi_env to get a cgi variable

    Using Forms 10g, on a UNIX server, I am trying to call this function: get_cgi_env('HTTP_CAMS_HTTP_USER') and assign the value for use in processing. I am trying to do this in my on-logon trigger of the form.
    Forms run-time is giving me :
    numeric or value error ORA 06512 at SYS.OWA_UTIL, line 356 ORA-06512 at SYS.OWA_UTIL line 375..
    Is it possible to use this function in Forms 10g running the 10g OAS, which is supposed to be based upon APACHE?
    Thank you,
    Tony Miller
    Webster, TX

    The value that the SSO package we use stores. It is the user's user id. We also have the actual session id in the SSO application available. AT this time, when we fire up a forms session, we have an .shtml file that calls the form url with a parameter, the session ID (from a cgi variable available to the .shtml file). I am trying to access that cgi variable so we DON'T need a parameter being passed on the url line for our main Form into the application..
    Thank you,
    Tony Miller
    Webster, TX

  • Owa_util.get_cgi_env( 'REMOTE_ADDR' ) fails with PLSQL numeric error

    APEX Listener 2.0.1
    APEX 4.2.2
    Oracle 11gR2
    Linux RHEL 6.3
    Glassfish 3.1.2
    =============
    After upgrading from APEX Listener 1.1.4 -> 2.0.1 the procedure owa_util.get_cgi_env( 'REMOTE_ADDR' ) fails to return the remote IP Address and instead I get the error
    ORA-06502: PL/SQL: numeric or value error
    Has something changed with the new APEX Listener 2.0.1?  Is there a configuration element in the config or web.xml file that has to be changed before deploying the APEX Listener to GlassFish?
    Thanks.

    Hi I cannot reproduce this issue, here's the test case I used, can you try this and report the output generated:
    create or replace procedure test_cgi as
    begin
    owa_util.print_cgi_env;
    htp.prn(owa_util.get_cgi_env( 'REMOTE_ADDR' ));
    end;
    grant execute on test_cgi to apex_public_user
    Then I invoke the above procedure as follows:
    http://localhost:8080/apex/<workspace-schema-name>.test_cgi
    where <workspace-schema-name> is the database schema that the APEX workspace is using.
    Which produces output like the following:
    host = localhost:8080
    user-agent = Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/17.0 Firefox/17.0
    accept = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    accept-language = en-US,en;q=0.5
    accept-encoding = gzip, deflate
    dnt = 1
    connection = keep-alive
    cookie = ORA_WWV_REMEMBER_UN=RESTEASY_ADMIN:resteasy; ORA_WWV_USER_61813546913094=461E06966F3D10A956FC84806D0CFF22
    APEX_LISTENER_VERSION = 2.0.3.199.09.35
    DAD_NAME =
    DOC_ACCESS_PATH =
    DOCUMENT_TABLE =
    GATEWAY_IVERSION = 3
    GATEWAY_INTERFACE = CGI/1.1
    HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    HTTP_ACCEPT_ENCODING = gzip, deflate
    HTTP_ACCEPT_LANGUAGE = en-US,en;q=0.5
    HTTP_ACCEPT_CHARSET =
    HTTP_IF_MODIFIED_SINCE =
    HTTP_IF_NONE_MATCH =
    HTTP_HOST = localhost:8080
    HTTP_ORACLE_ECID =
    HTTP_PORT = 8080
    HTTP_REFERER =
    HTTP_USER_AGENT = Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/17.0 Firefox/17.0
    PATH_ALIAS =
    PATH_INFO = /resteasy.test_cgi
    PLSQL_GATEWAY = WebDb
    QUERY_STRING =
    REMOTE_ADDR = 0:0:0:0:0:0:0:1
    REMOTE_USER = apex
    REQUEST_CHARSET = AL32UTF8
    REQUEST_IANA_CHARSET = UTF-8
    REQUEST_METHOD = GET
    REQUEST_PROTOCOL = http
    REQUEST_SCHEME = http
    SCRIPT_NAME = /apex
    SCRIPT_PREFIX =
    SERVER_NAME = localhost
    SERVER_PORT = 8080
    SERVER_PROTOCOL = HTTP/1.1
    SERVER_SOFTWARE = Mod-Apex
    WEB_AUTHENT_PREFIX =
    HTTP_COOKIE = ORA_WWV_REMEMBER_UN=RESTEASY_ADMIN:resteasy; ORA_WWV_USER_61813546913094=461E06966F3D10A956FC84806D0CFF22
    0:0:0:0:0:0:0:1

  • Owa_util.get_cgi_env('REMOTE_ADDR');

    Hi guys,
    I am using the following code for returning IP address, however it's not working as it's suppose to when I am executing my package. My main intent is to return the IP address of the user who is executing the package. When I am printing the IP address, it returns blank as shown below. Is there any settings related to Apache? Here's the code:
    PROCEDURE ERROR_PROC (p_proc_name IN VARCHAR2,
    p_OPERATOR IN VARCHAR2,
         p_ORA_ERROR IN VARCHAR2,
    p_INS_VALUES IN VARCHAR2,
    p_USER_ID IN VARCHAR2 DEFAULT NULL)
    IS
    PRAGMA autonomous_transaction;
    V_USER_ID VARCHAR2(4000);
    V_IP_Address VARCHAR2(4000);
    BEGIN
    BEGIN
    V_IP_Address:=owa_util.get_cgi_env('REMOTE_ADDR');
    EXCEPTION WHEN OTHERS THEN
    V_IP_Address:=NULL;
    dbms_output.put_line('IP Address is:'||V_IP_Address);
    END;
    END;
    Also, what tags to use here to enter the formatted code please? Looks like the above code will be unformatted after I submit the same here on the forum. Thanks for all your help.

    OraBI wrote:
    I am actually executing this procedure from my local machine (for testing) and spooling the output in a text file for the same purpose - testing.You cannot (easily) test web enabled PL/SQL code interactively - as the call should come, via mod_plsql, from an Apache server.
    You need to create a test harness procedure that simulates a web call from Apache's mod_plsql in the following fashion:
    SQL> create or replace type TStrings is table of varchar2(4000);
      2  /                                                         
    Type created.
    SQL>
    SQL> create or replace procedure WebTest is
      2  -- a sample web enabled PL/SQL procedure, using a cookie and CGI environment
      3  -- and outputting HTML                                                     
      4          cookie  OWA_COOKIE.cookie;                                         
      5  begin                                                                      
      6          OWA_UTIL.mime_header('text/html', TRUE );                          
      7          cookie := OWA_COOKIE.get( 'SOME_CUSTOM_COOKIE' );                  
      8                                                                             
      9          HTP.prn( 'What do you want, universe? (Klingon for "hello world")' );
    10          HTP.prn( '<hr>' );                                                  
    11                                                                              
    12          if cookie.vals.First is NULL then                                   
    13                  HTP.prn( 'Cookie [SOME_CUSTOM_COOKIE] is not set' );        
    14          else                                                                
    15                  HTP.prn( 'Cookie [SOME_CUSTOM_COOKIE] is set to "'|| cookie.vals( cookie.vals.First )||'"' );
    16          end if;                                                                                             
    17                                                                                                              
    18          HTP.prn( '<hr>' );                                                                                  
    19                                                                                                              
    20          HTP.prn( 'You are connection from web browser: '|| OWA_UTIL.get_cgi_env( 'HTTP_USER_AGENT' ) );     
    21          HTP.prn( 'Your IP address is '||OWA_UTIL.get_cgi_env('REMOTE_ADDR') );                              
    22  end;                                                                                                        
    23  /                                                                                                           
    Procedure created.
    SQL>
    SQL> create or replace function WebCall( procName varchar2, queryString varchar2 default null ) return TStrings pipelined is
      2  -- smaple test harness that pretends to Apache, mod_plsql and a browser, all rolled into one - it sets up a CGI       
      3  -- environment, makes the call to the web enables PL/SQL procedure, and then outputs the HTML response of that        
      4  -- procedure                                                                                                          
      5          nameList        OWA.vc_arr;                                                                                   
      6          valueList       OWA.vc_arr;                                                                                   
      7          htpBuffer       HTP.htbuf_arr;                                                                                
      8          bufRows         integer         := 99999999;                                                                  
      9          rc              integer;                                                                                      
    10  begin                                                                                                                 
    11          -- name-value list (typical CGI variables of an Apache server)                                                                    
    12          nameList(1) := 'HTTP_COOKIE';                                                                                 
    13          nameList(2) := 'HTTP_HOST';                                                                                   
    14          nameList(3) := 'HTTP_USER_AGENT';                                                                             
    15          nameList(4) := 'QUERY_STRING';                                                                                
    16          nameList(5) := 'REMOTE_ADDR';                                                                                 
    17          nameList(6) := 'REQUEST_METHOD';                                                                              
    18          nameList(7) := 'QUEST_URI';                                                                                   
    19                                                                                                                        
    20          valueList(1) := 'SOME_CUSTOM_COOKIE=123; SOME_OTHER_COOKIE=foo';                                              
    21          valueList(2) := 'localhost';                                                                                  
    22          valueList(3) := 'Mozilla/5.0; PL/SQL Interface';                                                              
    23          valueList(4) := nvl( queryString, 'param1=value1&pama2=value3' );       -- we built a sample one if one is not specified
    24          valueList(5) := 'localhost';                                                                                           
    25          valueList(6) := 'GET';                                                                                                 
    26          valueList(7) := '/custom-web-service';                                                                                 
    27                                                                                                                                 
    28          -- initiliase OWA and configure a basic CGI environment                                                                
    29          DBMS_SESSION.reset_package;                                                                                            
    30          rc := OWA.Initialize;                                                                                                  
    31          OWA.init_cgi_env( 7, nameList, valueList );                                                                            
    32          htp.HTBUF_LEN := 255;                                                                                                  
    33                                                                                                                                 
    34          -- now call the web enabled PL/SQL procedure                                                                           
    35          execute immediate 'begin '||procName||'; end;';
    36
    37          -- return the output as rows
    38          OWA.get_page( htpBuffer, bufRows );
    39          for i in 1..htpBuffer.Count
    40          loop
    41                  PIPE ROW( htpBuffer(i) );
    42          end loop;
    43
    44          return;
    45  end;
    46  /
    Function created.
    SQL>
    SQL> -- output below is what would have been seen by the web browser
    SQL> select
      2          rownum          as LINE_NO,
      3          b.column_value  as HTML_LINE
      4  from       TABLE( WebCall('WebTest') ) b
      5  /
       LINE_NO HTML_LINE
             1 Content-type: text/html
             2 Content-length: 200
             3
             4 What do you want, universe? (Klingon for "hello world")
             5 <hr>
             6 Cookie [SOME_CUSTOM_COOKIE] is set to "123"
             7 <hr>
             8 You are connection from web browser: Mozilla/5.0; PL/SQL Interface
             9 Your IP address is localhost
    9 rows selected.
    SQL>

  • Owa_util.get_cgi_env('REMOTE_ADDR') null

    Hello!
    I try to get client ip using following function:
    owa_util.get_cgi_env('REMOTE_ADDR')
    I simply put into a New-Form-Instance trigger something like:
    Ipaddr varchar2(20);
    Ipaddr:=owa_util.get_cgi_env('REMOTE_ADDR');
    Unfortunately, it returnes always NULL. Does anyone know why it is so ?
    Thanks :)

    I think that owa_util.get... it´s not correct in forms, try to use
    SYS_CONTEXT('USERENV','IP_ADDRESS'),
    bye

  • How to set an item when I redirect using OWA_UTIL.redirect_url

    I am using OWA_UTIL.redirect_url to redirect users.
    but I am lost in how do I set an item doing this. I have an item called :P101_MSG and I want to set it to 1.
    I added &:P101_MSG=1 this: OWA_UTIL.redirect_url ('f?p=&APP_ID.:101:&SESSION.*&:P101_MSG=1* ');
    but that was wrong.
    Can someone tell me the syntax to set P101_MSG=1 when I redirect.
    Howard

    Hi
    I'm not quite sure of what you're doing or where you are but this isn't how you set APEX items in the URL.
    See this example
    f?p=:&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.::::P1_ITEM1,P1_ITEM2:A,BThis sets item1 = A and item 2 = B.
    Is this what you mean (make sue you get the number of colons correct...
    Cheers
    Ben

  • 'owa_util.get_cgi_env does not return non-standard headers

    'owa_util.get_cgi_env does not return non-standard headers in embedded PL/SQL gateway even when the DAD attribute "cgi-environment-list" is set to pass
    such headers.
    Is this information correct?

    Hi,
    I came across the same problem today, my current understanding of the problem confirms your suspects, but I am still investigating the matter.
    If you made some progress on this, please share your thoughts.
    Flavio
    http://oraclequirks.blogspot.com
    http://www.yocoya.com

  • Can you set username and password when using OWA_UTIL.REDIRECT_URL?

    If you have a PSP that runs under a DAD that includes username and password and therefore doesn't require users to log in and you want it to do OWA_UTIL.REDIRECT_URL to another PSP that runs under another DAD that normally requires login using basic database authentication and the first PSP already "knows" the user's username and password, is there any way to use them to skip the login dialog of the second page? Maybe hack into the request and use UTL_HTTP.SET_AUTHENTICATION somehow...?

    That doesn't seem to work, and trying that kind of url directly from the browser says "invalid syntax error", so maybe Oracle appserver just doesn't let you do that.
    I got the idea of trying to add an authorization header:
    OWA_UTIL.MIME_HEADER(BCLOSE_HEADER => FALSE);
    HTP.P( 'Authorization: Basic mybase64encodedcredentials' );
    OWA_UTIL.REDIRECT_URL('myurl', FALSE);
    OWA_UTIL.HTTP_HEADER_CLOSE;
    ...but it didn't work either and with a little further thought I guess it's obvious why: any code here modifies the response header for this request, not the request header for the redirect.
    Message was edited by:
    psalmu

  • Problem using owa_util.redirect_url

    I thought I could use the following to branch.
    However it does not work. Is there anything else
    I should be doing to make this work
    declare
    begin
    owa_util.redirect_url('f?p=294:20');
    end;
    Howard

    Hi Patrick,
    My application is facing with the same problem, i even tried your suggested
    apex_application.g_unrecoverable_error := true; -- tells apex engine to quitBut still it didn't worked well. Is there any problem with owa_util.redirect_url() in APEX 4.1.1 newly released patch?
    Also is there any other way to set homepage for an application at the time of login?
    My exact requirement is, after the successful user login, my authentication scheme has post-authentication procedure, which gets the users default homepage from the table and redirects user to the retrieved homepage, like:
    owa_util.redirect_url('f?p='||:APP_ID||':'||page_Number||':'||v('SESSION')||'::NO:::');Regards,
    Krishna

  • Using owa_util.showpage

    Hi,
    I just learning how the package owa_util works in my db 10g and I don't Know why the code that I describe below give me a few errors:
    CREATE TABLE feds_data (
    tid       NUMBER(9),
    serial_no VARCHAR2(30),
    mfg_abbr  VARCHAR2(8),
    type_code VARCHAR2(5),
    mod_dt    DATE,
    mod_by    VARCHAR2(30));
    INSERT INTO feds_data
    (tid, serial_no, mfg_abbr, type_code, mod_dt, mod_by)
    VALUES
    (1, '42', 'BCAG', 'ABC', SYSDATE, USER);
    INSERT INTO feds_data
    (tid, serial_no, mfg_abbr, type_code, mod_dt, mod_by)
    VALUES
    (1, '666', 'MSC', 'XXX', SYSDATE, USER);
    commit;
    CREATE OR REPLACE PACKAGE feds_pkg IS
    PROCEDURE get_data;
    END feds_pkg;
    CREATE OR REPLACE PACKAGE BODY feds_pkg IS
    PROCEDURE get_data IS
    CURSOR gmi_cur IS
    SELECT tid, serial_no, mfg_abbr,
    type_code, mod_dt, mod_by
    FROM feds_data
    ORDER BY tid;
    ProcName VARCHAR2(61) := 'feds_pkg.get_data';
    HeadText VARCHAR2(2000) := 'Demo Page Header';
    FootText VARCHAR2(500) := 'Demo Page Footer';
    BEGIN
      htp.p(HeadText);
      htp.p('<form method="POST"><center>');
      htp.p('<table border="1" width="30%">');
      FOR i IN gmi_cur LOOP
        htp.p('<tr>');
        htp.p('<td align="center">');
        htp.p('<font face="Arial" color=#000000">');
        htp.p('<input type=text size=3 maxlength=3 name="tid"');
        htp.p('value = ' || i.tid || '></font>');
        htp.p('</td>');
        htp.p('<td align="center">');
        htp.p('<font face="Arial" color=#000000">');
        htp.p('<input type=text size=8 maxlength=8 name="serial_no"');
        htp.p('value = ' || i.serial_no || '></font>');
        htp.p('</td>');
        htp.p('<td align="center">');
        htp.p('<font face="Arial" color=#000000">');
        htp.p('<input type=text size=6 maxlength=6 name="serial_no"');
        htp.p('value = ' || i.mfg_abbr || '></font>');
        htp.p('</td>');
        htp.p('<td align="center">');
        htp.p('<font face="Arial" color=#000000">');
        htp.p('<input type=text size=1 maxlength=1 name="serial_no"');
        htp.p('value = ' || i.type_code || '></font>');
        htp.p('</td>');
        htp.p('<td align="center">');
        htp.p('<font face="Arial" color=#000000">');
        htp.p('<input type=text size=7 maxlength=7 name="serial_no"');
        htp.p('value = ' || TO_CHAR(i.mod_dt, 'MM-DD-YYYY') ||'></font>');
        htp.p('</td>');
        htp.p('<td align="center">');
        htp.p('<font face="Arial" color=#000000">');
        htp.p('<input type=text size=6 maxlength=6 name="serial_no"');
        htp.p('value = ' || i.mod_by || '></font>');
        htp.p('</td>');
        htp.p('</tr>');
      END LOOP;
      htp.p('<p align=center>');
      htp.p('<input type=submit name="Submit" value="Save"></p>');
      htp.p('</form></center>');
      htp.p('</table>');
      htp.p(FootText);
    END get_data;
    END feds_pkg;
    set serveroutput on
    spool c:\PLSQL\demopage.html
    exec feds_pkg.get_data;
    exec owa_util.showpage;
    spool offthe output error is:
    ORA-06502: PL/SQL: error numérico o de valor
    ORA-06512: en "SYS.OWA_UTIL",
    línea 356 ORA-06512: en "SYS.HTP",
    línea 1368 ORA-06512: en "SYS.HTP",
    línea 1443 ORA-06512: en "SYS.HTP",
    línea 1735 ORA-06512: en "HR.FEDS_PKG",
    línea 15 ORA-06512: en línea 1Thanks in advance....

    The htp package is meant for procedures that you call from the browser, not from sqlplus. Try this procedure call from your browser.
    There is a way to get a preview via sqlplus, but you need to fake a CGI environment. Search this forum, I know this topic has been addressed before.
    Here is one link:
    Re: HTML not working in PL/SQL block..Help me ASAP
    Edited by: InoL on May 20, 2011 3:40 PM

  • How to set #HOST# variable used in Chart template using Multiple Domains?

    I have a extended question to How can I set #HOST# variable referenced in the Chart template?
    In addition to the Proxy layer, we are looking to use multiple sub-domain names into the same Oracle APEX instance (through the one DAD) each mapped to a different application id. Therefore I don't think the solution in the link will work for me - as this embeds a single domain name in the DADS.CONF.
    Two questions:
    - Is it possible to set the "HTTP_HOST" in "dads.conf" using an existing HTTP Header value? - my proxy can pass on the original domain as "HTTP_X_FORWARDED_HOST". So if it was possible to use (say: using whatever form/syntax of parameterisation is available) ?
    >
    PlsqlCGIEnvironmentList HTTP_HOST=%{HTTP_X_FORWARDED_HOST}
    >
    If it can then that would work for me. It would be great if modl_plsql handled this out of the box as I understand the "X-FORWARDED" approach is pretty standard in the proxy world including passing on original IP addresses. Hitting an phpinfo() site shows headers
    >
    HTTP_X_FORWARDED_FOR     192.168.2.100
    HTTP_X_FORWARDED_HOST     dev.mycompany.com:443
    HTTP_X_FORWARDED_SERVER     mycompany.com
    >
    - Alternatively is it possible in APEX environment to set the #HOST# from the HTTP Header "HTTP_X_FORWARDED_HOST" if it exists for all requests?
    Thanks

    Hi Donna,
    changing the CGI environment variables HTTP_HOST, REQUEST_PROTOCOL and SERVER_PORT is the correct way how to resolve this, because it appears that your hiding the web server where you have installed mod_plsql or EPG by a different outside facing web server (also called reverse proxy). That's why APEX gets the host name, protocol and port of the internal web server, but should actually get the values of your reverse proxy web server. Can can fix that by changing the following CGI environment variables.
    HTTP_HOST should just contain the domain name (no protocol or port). For example: www.oracle.com
    REQUEST_PROTOCOL should contain http or https
    SERVER_PORT should be the port for https
    I don't want to add a new cgi variable called HOST because HOST sounds so generic and it might interfere with something else running in our environment. Or, I don't want to change the plsql cgi environment variable (such as HTTP_HOST) because many developers may use owa_util.get_cgi_env('HTTP_HOST') to get the current server. If the SERVER_PORT is part of the #HOST# then what could I change it to if it needs to be null. If you leave it blank, then the default SERVER_PORT comes from the CGI variables.The value of HTTP_HOST is wrong anyway and points to your internal web server, but I assume your developers actually want to get the host name of your external web server if they use it to generate absolute URLs. That's why I wouldn't bother and set it to the correct host name.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Problem with application item

    Hi everybody. I have created a apex application for three differents DNS. The interface changes depending the DNS entered in the browser.
    To do so, i changed the APACHE index.html BY adding some javascript
    var url1 = document.URL;
    if (url1 =="http://www.commandervanhoutte.com/")
         document.location ='http://www.commandervanhoutte.com/pls/htmldb/f?p=117';
    else if (url1 =="http://www.filterfreshordering.com/")
    document.location ='http://www.filterfreshordering.com/pls/htmldb/f?p=117:101:::NO::FTFRESH:O';
    else if (url1 =="http://www.buffetalacartevanhoutte.ca/")
    document.location ='http://www.buffetalacartevanhoutte.com/pls/htmldb/f?p=117:101:::NO::API_BUFFET:O';
         else
    document.location ='http://www.vanhoutteordering.com/pls/htmldb/f?p=117';
    If i enter, for example, www.filterfreshordering.com in the browser, everything works fine. My parameter <<FTFRESH>> change to 'O' and the interface change.
    THE PROBLEM IS
    If i enter www.filterfreshordering.com/pls/htmldb/f?p=117 directly in the browser, the system does not go through the index.html and my parameter FTFRESH is null
    I created a BEFORE HEADER PROCESS in the page 101(authentication page) with these conditions
    IF INSTR(UPPER(owa_util.get_cgi_env('HTTP_REFERER')),'FILTERFRESHORDERING',1) <> 0 AND
    NVL(:FTFRESH,'@') <> 'O' THEN
    :FTFRESH := 'O';
    END IF;
    IF nvl(:FTFRESH,'@') <> 'O' THEN
    --redirect to schooe the language FRENCH OR ENGLISH: choose language*/
    owa_util.redirect_url('f?p='||:APP_ID||':17:'||:SESSION);
    ELSE
    :API_LANGUE := 'A';
    :FSP_LANGUAGE_PREFERENCE := 'en';
    :API_REP :='/en/';
    owa_util.redirect_url('f?p='||:APP_ID||':101:'||:SESSION);
    END IF;
    The systeme always REDIRECT to page 17 even i set :FTFRESH to ‘O’ . and in the page 17 , FTFRESH is null.
    Any idea ?

    Hello,
    Beware the following from RFC 2616 "Hypertext Transfer Protocol -- HTTP/1.1":
    http://www.ietf.org/rfc/rfc2616.txt
    "Because the source of a link might be private information or might reveal an otherwise private information source, it is strongly recommended that the user be able to select whether or not the Referer field is sent."
    Some people, browsers, firewalls, and proxies choose not to send the Referer field, leading to a blank HTTP_REFERER.
    Did you see this thread? Using OWA_UTIL.GET_CGI_ENV
    Maybe that helps?
    Regards,
    Dimitri
    -- http://dgielis.blogspot.com/
    -- http://www.apex-evangelists.com/
    -- http://www.apexblogs.info/

  • How can I set #HOST# variable referenced in the Chart template?

    #HOST# and #HOST_PROTOCOL# are being set incorrectly by APEX from CGI variables when I create a chart. I am using APEX 4.1 and Oracle 11g. The get the continual "Loading data..." and then after it times out I get "Error loading file".
    Before we changed to a secure http environment, our charts worked. After we changed to the new web layer, the charts do not work. The #HOST# substitution was set to http://correctservername/ and #HOST_PROTOCOL# was set to http. We set PlsqlCGIEnvironmentList REQUEST_PROTOCOL=https in the dads configuration file and now the #HOST# displays https but it also includes the default port number which we do not want (https://correctservername:port/) The charts work without the port. REQUEST_PROTOCOL is not in the cgi list and setting this variable set #HOST_PROTOCOL#. What variable can we set to make #HOST# correct. It seems like #HOST# is being set by #REQUEST_PROTOCOL#'://'||HTTP_HOST||':'||SERVER_PORT||SCRIPT_NAME||'/'. SERVER_NAME could also be used in of HTTP_HOST. I don't know how APEX is setting #HOST#. Does it come from a host alias somewhere in the environment?
    I don't want to add a new cgi variable called HOST because HOST sounds so generic and it might interfere with something else running in our environment. Or, I don't want to change the plsql cgi environment variable (such as HTTP_HOST) because many developers may use owa_util.get_cgi_env('HTTP_HOST') to get the current server. If the SERVER_PORT is part of the #HOST# then what could I change it to if it needs to be null. If you leave it blank, then the default SERVER_PORT comes from the CGI variables.
    I would rather not create a global variable (hard-coding) and create a new chart template using the global variable or create a before header application process to re-direct url without a port.
    Edited by: Donna C-Houston on Oct 10, 2012 1:06 PM

    Hi Donna,
    changing the CGI environment variables HTTP_HOST, REQUEST_PROTOCOL and SERVER_PORT is the correct way how to resolve this, because it appears that your hiding the web server where you have installed mod_plsql or EPG by a different outside facing web server (also called reverse proxy). That's why APEX gets the host name, protocol and port of the internal web server, but should actually get the values of your reverse proxy web server. Can can fix that by changing the following CGI environment variables.
    HTTP_HOST should just contain the domain name (no protocol or port). For example: www.oracle.com
    REQUEST_PROTOCOL should contain http or https
    SERVER_PORT should be the port for https
    I don't want to add a new cgi variable called HOST because HOST sounds so generic and it might interfere with something else running in our environment. Or, I don't want to change the plsql cgi environment variable (such as HTTP_HOST) because many developers may use owa_util.get_cgi_env('HTTP_HOST') to get the current server. If the SERVER_PORT is part of the #HOST# then what could I change it to if it needs to be null. If you leave it blank, then the default SERVER_PORT comes from the CGI variables.The value of HTTP_HOST is wrong anyway and points to your internal web server, but I assume your developers actually want to get the host name of your external web server if they use it to generate absolute URLs. That's why I wouldn't bother and set it to the correct host name.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Oracle 8i OAS ip address

    Hello
    I use a Oracle Application server4.0 with Oracle8.1.6 & Solaris 2.7/
    In my PL/SQL procedure(for web), I want to Know the client IP address.
    But, when I use "owa_sec.get_client_ip"(return owa_util.ip_address) I can't get a correct result.
    What shall I do?
    My code is
    Create Or Replace Procedure p_iptest
    IS
    ipaddr owa_util.ip_address;
    v_count number;
    Begin
    ipaddr := owa_sec.get_client_ip;
    htp.p('<html><head></head><body>');
    v_count := ipaddr.count;
    htp.p(v_count);
    IF ipaddr IS NULL THEN
    htp.p('yes');
    ELSE
    htp.p('no');
    htp.p(TO_CHAR(ipaddr(1)));
    htp.p(TO_CHAR(ipaddr(2)));
    htp.p(TO_CHAR(ipaddr(3)));
    htp.p(TO_CHAR(ipaddr(4)));
    END IF;
    htp.p('</body></html>');
    END p_iptest;
    I get a result
    0 no Content-type:text/html Content-length :31 0 no
    help me!!!!
    P.S : PL/SQL Toolkit was installed

    You can use owa_util.get_cgi_env('REMOTE_ADDR');
    I hope help you....

  • Getting client IP Address via reverse proxy

    We're using APEX 4.2.1. I've configured APEX to recognise the X-Forwarded-For header so I can use owa_util.get_cgi_env ('X-Forwarded-For') when available to get the IP address of the client. Does APEX provide a safer way to access this header?
    In the APEX Instance Security configuration settings you can specify a comma separated list of proxy servers. This works fine for internal APEX logs, but how do I tap into this in my apps?
    What I'm looking for is a function that returns the X-Forwarded-For header when the client IP is in the proxy list or otherwise it returns the REMOTE_ADDR header, without having to maintain a list of trusted proxy IP's elsewhere. I don't want the two sources to inadvertently get out of sync.

    Also it may not be any use, e.g. if it is a 192.*.*.* or 10.*.*.* address allocated via NAT. For example it may not be unique among all poossible clients. If you need a client identity it is best to generate it yourself.

Maybe you are looking for

  • Group and Workspace are detached

    Hi there, I created a group "LMS-EMEA-JPE-DE" at that time the policy did not add automatically the ending Workspace to each auto-created workspace to a group. How can we get all current and future users for the Workspace and Group in sync. We also w

  • How to find out source code of portal

    Hi all,     I'm working ECC6.0.     In the portal there is a field managers substitute , when ever manager enteres . managers substitute name will populate.   the portal is constructed long back . it uses jsp.  I found out that portal applicarion cal

  • How do you see another month on the calendar or can you only see the current month only

    how do you see another month on the calendar or can you only see the current month only

  • How to get music from Apple TV to play through all 5.1 channels

    I recently set up a new 5.1 channel receiver and 5 very nice speakers. However, when I go to play music from Apple TV the sound only comes through to the front left and right speakers. Is there a way to play music through all 5 speakers? Is the recei

  • Spool is not gentrating

    Hi All, We r ctreating one job and assign the variant to that job .That job is already having the lot of varients Run the job but for new variant it is not gentrating spool .For same programm  with differnt variant it is gentrating the spool .But for