ezhttp
Summary
Returns GET, POST, session and cookie variables.Usage
ezhttp( name [, type [, check_existence ] ] )
Parameters
Name | Type | Description | Required |
---|---|---|---|
name | string | The HTTP variable that should be fetched. | Yes. |
type | string | Source of variable. Default is is HTTP POST. | No. |
check_existence | mixed | If the specified directive should be checked for existence. | No. |
Returns
Variable valueDescription
This operator makes it possible to inspect the contents of HTTP variables (POST, GET, session and cookie variables). The "type" parameter can be used to specify which type of variable that should be extracted. The following options are available:
- post (POST variable)
- get (GET variable)
- session (session variable)
- cookie (cookie variable)
The "check_existence" parameter can be set to TRUE or the string "hasVariable" in order to check if a directive is actually set. In this case, the operator will return either TRUE or FALSE. Note that using the "ezhttp_hasvariable" operator is a better option.
Examples
Example 1
{ezhttp( 'search' )}
Returns the "search" POST variable.
Example 2
{ezhttp( 'image', 'get' )}
Returns the "image" GET variable.
Example 3
{ezhttp( 'user_id', 'session' )}
Returns the "user_id" session variable.
Example 4
ezhttp( 'is_logged_in', 'cookie' )
Returns the 'is_logged_in' cookie variable.
Balazs Halasy (05/02/2004 10:33 am)
Geir Arne Waaler (26/08/2010 1:41 pm)
Comments