PHP Predefined Variables

$_SERVER['PHP_SELF']

This predefined variable shows the filename or path of the PHP page that is currently running.

Current value: /infost440/a3/predefined.php

$_SERVER['REQUEST_METHOD']

This predefined variable shows the request method used to open the page, such as GET or POST.

Current value: GET

Explanation

Predefined variables are variables that PHP already creates and makes available to the programmer. I do not have to create them myself before using them. They can provide useful information about the server, browser request, forms, cookies, sessions, and other parts of a webpage. Many predefined variables are also called superglobals because they can be used in different parts of a PHP script.

Back to Activity 3