/home/wpollock1/public_html/PHP/Session1.php
<?php session_start(); # This must be first byte in file!
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type"
content="application/xhtml+xml; charset=utf-8" />
<meta http-equiv="Vary" content="Content-language" />
<title> PHP Session test #1 </title>
<!-- Although better to use external style sheet,
for Q&D developement this is easier
-->
<style type="text/css" id="internalStyle">
<![CDATA[
body { background-color: cyan; }
h1 { text-align: center; }
]]>
</style>
<?php if ( isset($_SESSION['count']) )
{ ++$_SESSION['count'];
} else {
$_SESSION['count'] = 1;
}
?>
</head>
<body>
<div>
<h1> Session test #1 </h1>
<p>
On each reload of this page the <em>count</em> should increase by one.
</p>
<p>
The number of times you have loaded this page during the current
session is
<?php print $_SESSION['count'] ?>.
</p>
</div>
</body>
</html>