Systems Variable *WEBREFERRER

Date:12 July 2002
Product/Release:LANSA for the Web
Abstract:An example of using *WEBREFERRER system variable
Submitted By:LANSA Technical Support
Last Review:November 2010

*WEBREFERRER is a LANSA system variable which can be use to return the HTTP_REFERER Web server environment variable. This variable identifies which URL address is used to call a LANSA function on the browser.

An example to use the *WEBREFERRER:

  1. Imagine a Web site, for example <MySite> which has a static page designed with a hyperlink to access a LANSA function.
     
  2. The static page is called "Outline.htm" and it is located on this Web site: http://<MySite>/home/Outline.htm
     
  3. When the link in this static page is clicked a LANSA function is called from this Web site.
     
  4. In the LANSA function a system variable *WEBREFERRER is defined to detect the host Web site address:
* ******** Beginning of RDML commands *******
FUNCTION (*DIRECT *WEBEVENT)
DEFINE FIELD(#MYURL) TYPE(*CHAR) LENGTH(255) DECIMALS(0)
CHANGE FIELD(#MYURL) TO(*WEBREFERRER)
DISPLAY FIELDS((#MYURL) (#DATE)) EXIT_KEY(*NO) MENU_KEY(*NO) PR
OMPT_KEY(*NO)
* ********* End of RDML commands **********
  1. Hence, when this function is called via the link then the URL address of the original Web site calling the LANSA function will be displayed on the browser.

    In this example the LANSA function will displays this URL address: http://<MySite>/home/Outline.htm