It is essential that we sanitize incoming data by removing any unexpected data and ensuring that the data is of an expected type. Joomla! provides us with the static class
JRequest, which eliminates the need to directly access the request hashes
JRequest to its full potential we can perform useful data preprocessing. For detailed information on the
JRequest class see Appendix G
, Request and Session Handling.
To access a request value we must use the static
JRequest::getVar() method. In this example we get the value of the input
$id = JRequest::getVar('id');
If we wish we can define a default value; this is the value that will be returned ...