Part 7: Predefined

Activity 3 Homepage

Example Using $_SERVER

Server Name: jbsiburt.soisweb.uwm.edu

Server Software: Apache

Example Using $_GET

No query string provided.

What are Predefined Variables?

Predefined variables in PHP, also known as superglobals, are built-in variables that are always accessible, regardless of scope. They provide information about the server, environment, and user input, and are essential for handling data in web applications.

Explanation of Predefined Variables Used

$_SERVER: This superglobal contains information about headers, paths, and script locations. For example, `$_SERVER['SERVER_NAME']` returns the name of the server.

$_GET: This superglobal is used to collect data sent in the URL query string. For example, `$_GET['query']` retrieves the value of the 'query' parameter from the URL.