In all PHP scripts, a set of predefined variables is available to you. You might have seen some of these variables in the output of the phpinfo() function, if you scrolled and read through the entire results page. Some of these predefined variables are called superglobals, meaning that they are always present and available to all of your scripts, without any intervention by you, the programmer.
Please study the following list of superglobals, because they will be used extensively throughout this book. Each of these superglobals is actually an array of other variables. Don’t worry about fully understanding this concept now, because it will be explained as you move along through the book.
- $_GET contains any variables provided to a script through the GET method.
- $_POST contains any variables provided to a script through the POST method.
- $_COOKIE contains any variables provided to a script through a cookie.
- $_FILES contains any variables provided to a script through file uploads.
- $_ENV contains any variables provided to a script as part of the server environment.
- $_SESSION contains any variables that are registered in a session.