|
Web+ Tutorial
|
Lesson 2.4 - Reading CGI Variables
A number of CGI (Common Gateway Interface) environment variables are made available to scripts by browser and server software. These variables contain contextual information on requests made to the script (e.g. what address is the request from, what browser software is the client running, what is the authenticated username of the client, etc.). CGI environment variables may be used with Insert and Update actions (to input data into tables) and with Query actions (to customize the behavior of templates). The variables available to your applications depend upon the browser and server software in use for a given request (refer to the latest standards documents as well as your server software's documentation to determine exactly what variables are available).
- Description
- For a description of the available CGI environment variables, see the NCSA CGI Specification.
- Syntax
#CGI.VariableName#
- Agument
VariableName refers to any CGI environment variable sent to the script by the browser or the server.
- Example
Your browser is #CGI.HTTP_User_Agent#.
- Sample
<webPrint><webIf #len (CGI.Remote_Host) gt 0#> You are visiting us from #CGI.Remote_Host#. <webElse> You are visiting us from #CGI.Remote_Addr#. </webIf></webPrint>
- Result:
- Exercise
-
You can try out some Web+ code of your own here.
|
|