API16

JRequest/get

< API16:JRequest

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description

Fetches and returns a request array.



Syntax

static get($hash= 'default', $mask=0)
Parameter Name Default Value Description
$hash 'default' $hash to get (POST, GET, FILES, METHOD).
$mask 0 $mask Filter mask for the variable.

Returns

mixed Request hash.

Defined in

libraries/joomla/environment/request.php

Importing

jimport( 'joomla.environment.request' );

Source Body

public static function get($hash = 'default', $mask = 0)
{
        $hash = strtoupper($hash);

        if ($hash === 'METHOD') {
                $hash = strtoupper($_SERVER['REQUEST_METHOD']);
        }

        switch ($hash)
        {
                case 'GET' :
                        $input = $_GET;
                        break;

                case 'POST' :
                        $input = $_POST;
                        break;

                case 'FILES' :
                        $input = $_FILES;
                        break;

                case 'COOKIE' :
                        $input = $_COOKIE;
                        break;

                case 'ENV':
                        $input = &$_ENV;
                        break;

                case 'SERVER':
                        $input = &$_SERVER;
                        break;

                default:
                        $input = $_REQUEST;
                        break;
        }

        $result = self::_cleanVar($input, $mask);

        // Handle magic quotes compatability
        if (get_magic_quotes_gpc() && ($hash != 'FILES')) {
                $result = self::_stripSlashesRecursive($result);
        }

        return $result;
}



Examples

Code Examples


Advertisement