CGI - web form variables

Dave Cragg dcragg at lacscentre.co.uk
Tue Sep 14 03:23:13 EDT 2004


On 13 Sep 2004, at 19:18, J. Landman Gay wrote:

> On 9/13/04 10:53 AM, Gregory Lypny wrote:
>
>> Hello everyone,
>> Where can I learn about $QUERY_STRING and other variables that are 
>> relevant to processing web forms?  I noticed that Jacqueline uses 
>> this in her Fiction Search example, and my guess is that it returns 
>> the values of form fields that have been typed in by users.
>
> Nope, these are HTTP environment variables, set by the server. Not all 
> environment variables are supported by every server; it depends on 
> your ISP and what they allow. Environment variables always start with 
> a dollar sign and are always available; they automatically become 
> global variables when the script starts up. Here is a list of most of 
> them:
>
> <http://www.lib.washington.edu/asp/browser/servar.asp>
>
Just a little additional information. If you add custom headers to your 
http requests, these headers will have an environment variable set that 
matches the header name with "$HTTP_" prepended.

So if, for example, you set a custom header like this:

   set the httpheaders to "MYACTION: getdata,123x"

The CGI script will have access to an environment variable named 
$HTTP_MYACTION whose value will be "getdata,123x".

Dave



More information about the use-livecode mailing list