quick server pages
   
Manual page for getting(cgi)

Getting CGI user variables and cookies

The following directives get incoming CGI user variables and cookies and make them available as QUISP variables. This is usually done at the top of the page, and must be done before the variable contents can be displayed or referenced. In all cases, if a named CGI user variable or cookie is not present, the variable is set to a zero-length string (""); if desired, the #setifnotgiven directive may be used subsequently to set these to a default value.


#cgivar

Gets one or more ordinary CGI user variables.

Usage: #cgivar varname1 [,] .. varnameN

Example: #cgivar id mode size

Example: #cgivar id, mode, size

Note: a directive called #sqlcgivars is also available.. it captures a CGI user variable for each field in a database table.. it is described here.


#cgilistvar

Gets user variable(s) resulting from of submitted CGI form <SELECT MULTIPLE> responses, representing the result as a comma-delimited list of the selected VALUEs.

#cgilistvar should also be used to capture previously converted comma-delimited lists that have been #pass'ed.

Usage: #cgilistvar varname1 [,] .. varnameN

Example: #cgilistvar categories


#cgimultivar

Gets one or more user variables that are the result of CGI form <SELECT MULTIPLE> box(es), where the result is not to be represented as a comma-delimited list. Variables imported this way can be used with #for .. across .. to do things like saving multiple responses as individual rows, without the list length restrictions.

Example: #cgimultivar categories


#cgitextvar

Gets one or more user variables that are the result of CGI form <TEXTAREA>. Variables imported this way can be used with the #savetext or #showtext directives.

Example: #cgitextvar comments, routing_notes


#cookie

Gets the contents of one or more HTTP cookies. Cookie content is truncated to 250 characters. Cookie name should be less than 40 characters. No character escaping or translation is done with cookie name or contents.

Cookies are useful for storing user-specific information and preferences. However, there are limitations: they are easily viewed and modified by users, and if a user turns off cookies or uses a different computer or browser expected cookies may not be present.

Usage: #cookie cookiename1 .. cookienameN

Example: #cookie SESS_ID

To set a cookie add an HTTP Set-Cookie statement as the first output line of your template page. No content or whitespace is permitted to precede the word Set-Cookie. Example:


 #cookie SESS_ID
 #if @SESS_ID = ""
   #+ Set-Cookie: SESS_ID=0099; path=/cgi-bin; expires=Friday, 31 Dec 2010 10:10:10 GMT
 #endif




quick server pages    
Copyright Steve Grubb    


Markup created by unroff 1.0,    April 12, 2004.