The Request object provides access to the values that the browser passed to the server during an HTTP request.
Request.property|method([parameters])
CurrentChannel | The number of the channel serving the current request. |
PathInfo | Extra path information as given by the client. This parameter mirrors the information passed by the browser in the PATH_INFO server variable. |
ProgramPath | The directory where the requested script resides. |
ProgramRoot | The effective program root for the requested server. |
ScriptParams | The part of the URL that is after the script name, but before the query string. |
StartSeconds | The number of seconds since midnight from the time the request was received. |
StartTime | The date and time that the request was received. |
CookieArray | Returns an array with all cookies sent by the client. Optionally, it can filter all occurrences of a particular cookie. |
CookieCount | Returns the total number of cookies, or the total number of occurrences of a single cookie. |
Form | Returns the content of a form field passed to the server as part of a POST request. |
FormArray | Returns an array with all POST fields, or all instances of a particular field. |
FormCount | Returns the total number of POST fields, or the total number of occurrences of a single field. |
FormFieldObject | Returns an object which contains information about a particular POST field. This function is especially useful when processing uploaded files. |
GetCookie | Returns the value of a cookie sent by the HTTP client. |
Item | Searches all browser input (The query string, form variables, cookies and the server variables) for a particular value. |
QueryString | Returns the content of a field sent by the browser in the Query String portion of the URL. |
QueryStringArray | Returns an array with all Query String fields, or all instances of a particular field. |
QueryStringCount | Returns the total number of Query String fields, or the total number of occurrences of a single field. |
ServerVariables | Returns the content of a Server Variable, sent by the browser, or provided by the Web server. |
ServerVariablesArray | Returns an array with all Server Variables. |
ServerVariablesCount | Returns the total number of Server Variables. |
The Request.CurrentChannel property returns the number of the channel serving the current request.
This property is read only.
nChannel = Request.CurrentChannel
The Request.PathInfo property returns the extra path information as given by the client. This parameter mirrors the information passed by the browser in the PATH_INFO server variable. This property is read/write and can be modified in the FW_ENTER global procedure, in order to redirect FoxWeb to a different script than the one requested by the user.
The PathInfo property can also be used to construct self-referencing URLs in cases where the use of relative URLs is not possible.
This property is read/write.
Request.PathInfo = cPath
The Request.ProgramPath property returns the physical directory where the requested script resides.
This property is read only.
cPath = Request.ProgramPath
The Request.ProgramRoot property returns the effective Program Root directory for the requested virtual server.
This property is read only.
cPath = Request.ProgramRoot
The Request.ScriptParams property returns the part of the URL that is after the .fwx script name, but before the query string. Some sites (including the FoxWeb Forum) utilize such URLs to create parameterized pages that are indexed by certain search engines that do not support query strings. For example, then URL
This property is read only.
cScriptParams = Request.ScriptParams
The Request.StartSeconds property returns the number of seconds that have elapsed since midnight from the time that the request was received. This property is populated by calling VFP's SECONDS() function right before starting execution of the requested script. Request.StartSeconds returns a numeric value in decimal format, with a resolution of 1 millisecond. If you are running Windows NT 4.0 or later, resolution is 10 milliseconds.
This property is read only.
nSeconds = Request.StartSeconds
The Request.StartTime property returns the date and time that the request was received. This property is populated by calling VFP's DATETIME() function right before starting execution of the requested script.
This property is read only.
tDateTime = Request.StartTime
The Request.CookieArray method returns an array with all cookies sent by the client. Optionally, it can filter all occurrences of a particular cookie.
nTotCookies = Request.CookieArray(@aCookies[, cCookieVar])
A two-dimensional array that gets populated with all the cookie pairs. This parameter must be passed by-reference, by preceding its name with the "@" character.
Optional parameter that contains the name of the cookie whose instances should populate the aCookies array. It is possible for the browser to send multiple instances of a cookie with the same name, if it has received the same cookie with different path designators.
Numeric: The number of rows in the output array.
The Request.CookieCount method returns the total number of cookies, or the total number of instances of a single cookie.
nTotCookies = Request.CookieCount([cCookieVar])
Optional parameter, which contains the name of the cookie whose number of instances should be returned. It is possible for the browser to send multiple instances of a cookie with the same name, if it has received the same cookie with different path designators. If this parameter is omitted then the total number of cookies is returned.
Numeric: The total number of cookies, or the number of instances of a particular cookie, sent by the browser.
The Request.Form method returns the values of form fields posted to the HTTP request body by a form using the POST method.
cFieldValue = Request.Form([cFormVar, [nIndex]])
Specifies the name of the form field from which the method is to retrieve values.
Optional parameter that contains the desired instance of cFormVar. You can determine the total number of instances of a particular field with the Request.FormCount method. If multiple instances of the same field exist and this parameter is omitted, then the function returns all values, as a comma-delimited string.
Character: The value of the specified field.
When you use parameters with Request.Form, the Web server parses the HTTP request body and returns the specified data. If your application requires un-parsed data from the form, you can access it by calling Request.Form() without any parameters. If the requested field was not sent by the browser then this method will return an empty string. To distinguish between form fields that contain an empty string and form fields that were not sent use the Request.FormCount method.
The Request.FormArray method returns an array with all form fields sent by the client. Optionally, it can filter all occurrences of a particular field.
nTotFields = Request.FormArray(@aFormFields[, cFormVar])
A two-dimensional array that gets populated with all the form elements and their values. This parameter must be passed by-reference, by preceding its name with the "@" character.
Optional parameter that contains the name of the field whose instances should populate the aFormFields array.
Numeric: The number of rows in the output array.
The Request.FormCount method returns the total number of form fields submitted through the POST method, or the total number of instances of a single field.
nTotFields = Request.FormCount([cFormVar])
Optional parameter, which contains the name of the field whose number of instances should be returned. If this parameter is omitted then the total number of fields is returned.
Numeric: The total number of form fields, or the number of instances of a particular field, sent by the browser.
The Request.FormFieldObject method is similar to Request.Form, but instead of returning just the value of a POST field, it returns an object, which contains extended information. This method is especially useful when processing uploaded files, because it exposes information such as the original file name, the size of the file, its contents and its mime type.
oFormField = Request.FormFieldObject([cFormVar, [nIndex]])
Specifies the name of the form field.
Optional parameter that contains the desired instance of cFormVar. You can determine the total number of instances of a particular field with the Request.FormCount method. If multiple instances of the same field exist and this parameter is omitted, then the function returns all values, as a comma-delimited string.
FormField object. The following table describes the properties and methods of FormField objects:
ContentDisposition | The value of the ContentDisposition header for the field. This value is only populated for uploaded files. |
ContentLength | The size of the form field. |
ContentStart | The field's position in the POST data buffer. |
ContentType | The field's content type, as provided by the browser. |
FileName | The uploaded file's original file name, as provided by the browser. This value is only populated for uploaded files. |
FieldName | The field name. |
Value() | This method returns the contents of the field. |
The Request.GetCookie method returns the values of Cookies sent by the browser.
cFieldValue = Request.GetCookie([cCookieVar, [nIndex]])
Specifies the name of the cookie whose value we want to retrieve.
Optional parameter that contains the desired instance of cCookieVar. It is possible for the browser to send multiple instances of a cookie with the same name, if it has received the same cookie with different path designators. If this parameter is omitted then the instance with the most specific path is returned. You can determine the total number of instances of a particular cookie with the Request.CookieCount method.
Character: The value of the specified cookie.
When you use parameters with Request.GetCookie, the Web server parses the HTTP_COOKIE Server Variable and returns the specified value. If your application requires un-parsed data, you can access it by calling Request.GetCookie() without any parameters, or Request.ServerVariables("HTTP_COOKIE"). If the requested cookie was not sent by the browser then this method will return an empty string. To distinguish between cookies that contain an empty string and cookies that were not sent use the Request.CookieCount method.
The Request.Item method searches browser input for a particular value. The following collections are searched in the order listed:
cFieldValue = Request.Item([cVarName, [nIndex]])
Specifies the name of the variable whose value we want to retrieve.
Optional parameter that contains the desired instance of cVarName.
Character: The value of the specified variable.
If a value with the same name exists in more than one collection then the method returns the first instance that it encounters. For improved performance it is recommended that you use a more specific method than Item wherever possible. For example, use Request.ServerVariables("PATH_INFO") instead of Request.Item("PATH_INFO").
The Request.QueryString method returns the values of the variables in the HTTP Query String. The Query String contains values passed to your script as text following a question mark in the URL. The values can be appended to the URL by using either the HTTP GET method or by manually appending the values to the URL.
cFieldValue = Request.QueryString([cQueryStringVar, [nIndex]])
Specifies the name of the Query String variable from which the method is to retrieve values.
Optional parameter that contains the desired instance of cQueryStringVar. You can determine the total number of instances of a particular variable with the Request.QueryStringCount method. If multiple instances of the same variable exist and this parameter is omitted, then the function returns all values, as a comma-delimited string.
Character: The value of the specified variable.
When you use parameters with Request.QueryString, the Web server parses the Query String portion of the URL and returns the specified data. If your application requires un-parsed data, you can access it by calling Request.QueryString() without any parameters, or by calling Request.ServerVariables("QUERY_STRING"). If the requested variable was not sent by the browser then this method will return an empty string.
The Request.QueryStringArray method returns an array with all variables sent in the HTTP Query String sent by the client as part of the URL. Optionally, it can filter all occurrences of a particular variable.
nTotVars = Request.QueryStringArray(@aQueryStringVars[, cQueryStringVar])
A two-dimensional array that gets populated with all the QueryString variables and their values. This parameter must be passed by-reference, by preceding its name with the "@" character.
Optional parameter that contains the name of the variable whose instances should populate the aQueryStringVars array.
Numeric: The number of rows in the output array.
The Request.QueryStringCount method returns the total number of Query String variables, or the total number of instances of a single variable.
nTotVars = Request.QueryStringCount([cQueryStringVar])
Optional parameter, which contains the name of the variable whose number of instances should be returned. If this parameter is omitted then the total number of variables is returned.
Numeric: The total number of Query String variables, or the number of instances of a particular variable, sent by the browser.
The Request.ServerVariables method returns the values of the environment variables known as HTTP Server Variables. The Server Variables is a collection of values that provides information from the HTTP headers, passed along with a user�s request, as well as information provided by the Web server, regarding the current request.
cValue = Request.ServerVariables([cServerVariable])
Specifies the name of the Server Variable whose value we are trying to retrieve.
Character: The value of the specified variable.
Unlike other elements returned by the Request object, there may not be more than one instance of a particular Server Variable. If the requested variable does not exist then this method will return an empty string. Calling Request.ServerVariables() without any parameters will return the buffer that holds all the Server Variables passed on to FoxWeb.
Following is a list of most Server Variables with brief descriptions.
Note: Not all variables below will be available to your scripts. The list of variables that are exposed to your scripts will depend on the individual request, the Web server being used, whether you are using the CGI or ISAPI module, and the type of browser that originated the request.
The Request.ServerVariablesArray method returns an array with all Server Variables passed on to FoxWeb.
nTotVars = Request.ServerVariablesArray(@aServerVars)
A two-dimensional array that gets populated with all Server Variables and their values. This parameter must be passed by-reference, by preceding its name with the "@" character.
Numeric: The number of rows in the output array.
The Request.ServerVariablesCount method returns the total number of Server Variables passed to FoxWeb
nTotVars = Request.ServerVariablesCount()
Numeric: The total number of Server Variables.