wwRequest::Querystring

This method returns the Query String and individual pieces of it. The method supports both numeric,positional parameters and named parameters. Positional parameters are great for grabbing request information:

wc.dll?wwDemo~ClientForm~West+Wind+Technologies~ID0001

where each parameter can be accessed using Request.QueryString(1) through QueryString(4). Web Connection typically uses the first two positional parameters to identify the request that is being accessed so wwDemo is the class to call and ClientForm is the method inside of that class for example. Parameters 3 and 4 are application specific parameters.

URLEncoded parameters are better for optional parameters and look like this:

wc.dll?UserName=Rick+Strahl&UserId=0111&Address=400+Morton%0A%0Dhood+River,+OR

Essentially spaces are converted to + signs, keys are separated by & and any control characters are converted to hex representations preceeded by a % sign.

You can mix positional and URLEncoded parameters by adding a separating ~ between the posititional parms and the named ones:

wc.dll?wwdemo~URLTest~&Username=Rick+Strahl&Company=West+Wind

which allows you to use both GetCGIParameter(2), which returns URLTest or QueryString("Company") which returns West Wind.

o.QueryString(lvKey)

Return Value

String value of the requested key.

Parameters

lvKey
This parameter can either be a string or numeric value.


  • Named parameter string
    The key of a named parameter is returned. For example:

    http://localhost/wc.wc?wwDemo~TestPage~&Company=West+Wind&Name=Rick

    where Company and Name would be key values to retrieve.

  • Positional numerical value
    You can also pass a numeric value to get at positional parameters separated by ~. In the above example, QueryString(1) returns wwDemo, QueryString(2) TestPage.

Make sure when mixing positional and named parameter that you separate the two with a ~ and & as the link above does.


See also:

Class wwrequest | wwRequest::ServerVariables | wwRequest::Form

© West Wind Technologies, 1996-2018 • Updated: 09/06/99
Comment or report problem with topic