Searching for "Superglobal"

Q:

Explain Superglobal variables in PHP .

Answer

To access the global data which is originating externally, the super globals are used. The superglobals are available as arrays. These superglobals represents the data from URLs, HTML forms, cookies, sessions and also the web server. For this purpose, $HTTP_GET_VARS, $HTTP_POST_VARS are used. The super globals are pretty good enough to be used in functions. The following are the list of super globals.


$_GET, $_POST, $_COOKIE;$_REQUEST, $_SERVER, $_SESSION, $_ENV, $_FILE


Another PHP Superglobal, called $GLOBALS; is available for persisting every variable with global scope.

Report Error

View answer Workspace Report Error Discuss

Subject: PHP

Q:

Explain $_FILES Superglobal Array.

Answer

Array                                              Descriptions
--------------------------------           -----------------------------------
$_FILES['userfile']['name']              The original name of the file on the client machine.




$_FILES['userfile']['type']                The MIME type of the file if the browser provided 


                                                   this information. An example would be "image/gif".




$_FILES['userfile']['size']                The size, in bytes, of the uploaded file.




$_FILES['userfile']['tmp_name']      The temporary filename of the file in which the


                                                  uploaded file was stored on the server.




$_FILES['userfile']['error']              The error code  associated with this file upload.

Report Error

View answer Workspace Report Error Discuss

Subject: PHP