PHP Predefined Variables

Example 1: $_SERVER

Current PHP page: /440/activity3/predefined.php

Example 2: $_GET

No name was sent in the URL. Try adding ?name=Alex to the end of the URL.

Explanation

Predefined variables are variables that PHP creates automatically and makes available to a script. Many of them are called superglobals because they can be used from different parts of a PHP program. The $_SERVER variable provides server and page information, while $_GET contains data sent through the page URL.

Back to Activity 3