Assignment 1

Barry Molina

Predefined

Predefined variables contain information about the server's operating environment.

They can be accessed by typing $_SERVER followed by the variable name:

$server_addr = $_SERVER['SERVER_ADDR'];
$server_name = $_SERVER['SERVER_NAME'];
$remote_addr = $_SERVER['REMOTE_ADDR'];

echo "The server's host name is $server_name";
echo "The server's IP address is $server_addr";
echo "Your IP address is $remote_addr";

Output:

The server's host name is mail.bhmolina.soisweb.uwm.edu
The server's IP address is 129.89.43.13
Your IP address is 18.119.118.169
predefined.php source code screenshot