|
Phpr_Request class
Incapsulates information about the HTTP request.
An instance of this class is always available through the $Phpr class and you never need to create it manually:
1. $ip = Phpr:: $request ->getUserIp(); See AlsoPublic methods
Method details¶ cookie() methodpublic mixed cookie(string $name)
Returns a cookie value by the cookie name.
If a cookie with the specified name does not exist, returns NULL.
¶ getField() methodpublic mixed getField(string $name, mixed $default=false)
Returns a named GET parameter value.
See Also¶ getRequestMethod() methodpublic string getRequestMethod()
Returns the current request method name - POST, GET, HEAD or PUT.
¶ getUserAgent() methodpublic mixed getUserAgent()
Returns a name of the User Agent.
If user agent data is not available, returns NULL.
¶ getUserIp() methodpublic string getUserIp()
Returns the visitor's IP address.
¶ port() methodpublic integer port()
Returns HTTP port number.
If STANDARD_HTTP_PORTS parameter is set to TRUE in config.php file,
the method returns NULL.
¶ post() methodpublic mixed post(string $name, mixed $default=NULL)
Returns a named POST parameter value.
If a parameter with the specified name does not exist in POST, returns NULL or a value
specified in the $default parameter.
See Also¶ post_array_item() methodpublic mixed post_array_item(string $array_name, string $name, mixed $default=NULL)
Finds an array in the POST data then finds and returns an element inside this array.
If the array or the element do not exist, returns null or a value specified in the $default parameter.
This method is useful for extracting form field values if you use array notation for the form input element names. For example, if you have a form with the following fields 1. <input type= "text" name= "customer_form[first_name]" > 2. <input type= "text" name= "customer_form[last_name]" > 1. $first_name = Phpr:: $request ->post_array_item( 'customer_form' , 'first_name' ) See Also¶ protocol() methodpublic string protocol()
Returns HTTP protocol name - http or https.
|