Please send questions to
st10@humboldt.edu .
<?php
session_start();
?>
<!-- if using cookie-based sessions, must do above before ANY
output sent to browser, according to
http://www.php.net/manual/en/function.session-start.php
... even <html>, even a blank line!!!!
-->
<html>
<!-- try_session1.php
adapted from example from www.php.net manual,
http://www.php.net/manual/en/ref.session.php
adapted by: Sharon Tuttle
last modified: 4-18-06
-->
<head>
<title> playing with PHP sessions </title>
</head>
<body>
<h2> playing with PHP sessions </h2>
<?php
// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less
if (!isset($_SESSION['count']))
{
$_SESSION['count'] = 0;
}
else
{
$_SESSION['count']++;
}
echo "count variable for this session is: ".$_SESSION['count'];
?>
</body>
</head>