How to GET POST request data in Joomla?
To retrieve GET/POST request data, Joomla! uses the getVar method of the JRequest class (JRequest::getVar ()). If you have a form variable named ‘address’, you would want to use this code to get it: Unless other parameters are set, all HTML and trailing whitespace will be filtered out.
How is the task parameter used in Joomla?
Joomla uses the HTTP Request task parameter to determine which controller should be used. The task parameter can be sent in an HTTP GET or an HTTP POST – in fact, Joomla doesn’t really make a distinction between GET and POST parameters – but the task parameter is just an ordinary HTTP parameter, nothing special.
How to follow the HTTP pattern in Joomla?
To follow the Joomla pattern, in the code which handles the POST we should include a HTTP GET redirect to the form URL. As that GET will then be a new HTTP request/response we must store in the user session the data to be shown when the form is redisplayed:
How does the submit button work in Joomla?
The user enters data into your HTML form and clicks on the submit button. The browser generates an HTTP POST request to the URL specified in the element and passes to the server in POST parameters the values entered by the user; each parameter keyed by the “name” attribute of the HTML input element.
How to retrieve user state variables in Joomla?
There are also two ways to retrieve user state variables. The first is using the JApplication::getUserState method, and the second is to use the JApplication::getUserStateFromRequest method.
How is the limit variable stored in Joomla?
The first variable that is stored is the limit variable. The limit variable specifies how many records should be retrieved from the database and displayed. Note that there is no $option prefix in the $key parameter. This variable is used as a global parameter (and its initial value is retrieved from the site configuration value).
Why do we need session handling in Joomla?
Joomla!’s built in session handling capabilities make it easy to retain values of certain variables across page accesses. This makes development much simpler because the developer no longer has to worry about losing variable values if it is left out of a form.