Predefined Variables

Server Information


Warning: Undefined variable $server_name in /home/ztgramza/public_html/INFOST440/a3/predefined.php on line 19
Server Name:

Warning: Undefined variable $server_software in /home/ztgramza/public_html/INFOST440/a3/predefined.php on line 20
Server Software:

What Are Predefined Variables?

Predefined variables in PHP are built-in global variables that provide useful information about the server, environment, and user inputs. These variables are automatically available without needing to declare them.

The $_SERVER variable, for example, contains details about the server and request. $_SERVER['SERVER_NAME'] returns the domain name of the server, while $_SERVER['SERVER_SOFTWARE'] provides the web server software name and version. This type of information is critical to PHP programmers to help build secure, and efficent web apps.