/home/wpollock1/public_html/PHP/Session2.php
1: <?php require_once "session_prolog.php"; # This must be first!
2: ?>
3: <head>
4: <meta http-equiv="Content-Type"
5: content="application/xhtml+xml; charset=utf-8" />
6: <meta http-equiv="Vary" content="Content-language" />
7:
8: <title> PHP Session Test #2 </title>
9:
10: <!-- Although better to use external style sheet,
11: for Q&D developement this is easier
12: -->
13: <style type="text/css" id="internalStyle">
14: <![CDATA[
15: h1 { text-align: center; }
16: ]]>
17: </style>
18:
19: <?php if ( isset($_SESSION['count']) )
20: { ++$_SESSION['count'];
21: } else {
22: $_SESSION['count'] = 1;
23: }
24: ?>
25:
26: </head>
27:
28: <body>
29: <div>
30: <h1> Session Test #2 </h1>
31:
32: <p>
33: On each reload of this page the <em>count</em> should increase by
34: one.
35: In this version the file prolog is generated by an external PHP
36: file included at the top of this one.
37: </p>
38:
39: <p>
40: The number of times you have loaded this page during the current
41: session is
42: <strong><?php print $_SESSION['count'] ?></strong>.
43: </p>
44:
45: <p>
46: (Delete the session cookie to reset count.)
47: </p>
48:
49: </div>
50: </body>
51: </html>