PHP Predefined Variables

$_SERVER["PHP_SELF"]: /infost440/assignment2/predefined.php

Contains the filename of the current script.

$_SERVER["SERVER_NAME"]: kdyess.soisweb.uwm.edu

Contains the name of the web server.

$_SERVER["REQUEST_METHOD"]: GET

Shows whether the request used GET, POST, or another method.

Explanation

Predefined variables are variables that PHP automatically creates and makes available to scripts. They provide information about the server, request, files, sessions, cookies, and other parts of the current environment. Developers can use them without manually creating or assigning their values first.

Return to Index