PHP Percolate! Season 6 (19 Chapters)

Student: Jim Merrikin

script 1.5 - predefined.php

OUTPUT:

You are running the file:
/home/jmerriki/public_html/edu/percolate/chapter1/predefined.php.

You are viewing this page using:
CCBot/2.0 (http://commoncrawl.org/faq/).

This server is running:
Apache.

East Bridgewater, Massachusetts
East Bridgewater, Massachusetts 02333
The magical golden ratio is defined as: 1.61803398875
$194.55
$194.55

CODE:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>J. Merrikin - 1.5 Predefined Variables</title>
		<link rel="stylesheet" type="text/css" href="../common.css" />
	</head>
	<body>
		<!-- Script 1.5 - predefined.php -->
		<?php
			$file = $_SERVER['SCRIPT_FILENAME'];
			$user = $_SERVER['HTTP_USER_AGENT'];
			$server = $_SERVER['SERVER_SOFTWARE'];

			//Print the name of this script
			echo "<p>You are running the file:<br /><b>$file</b>.</p>\n";

			//Print the user's information
			echo "<p>You are viewing this page using:<br /><b>$user</b>.</p>\n";

			//Print the server's information
			echo "<p>This server is running:<br /><b>$server</b>.</p>\n";

			$city = 'East Bridgewater';
			$state = 'Massachusetts';
			$address = "$city, $state";

			echo "$address<br />";

			$address .= " 02333";
			echo "$address";

			define ('GOLDEN_RATIO',1.61803398875);

			echo '<br />The magical golden ratio is defined as: ' . GOLDEN_RATIO . '<br />';

			$amount = 194.55;
			echo "\$$amount<br />";
			echo '$'.$amount.'<br />';
		?>
	</body>
</html>