fluidthoughts developers' guild

fluid funk

howto / php / session counter

Session counter example

The counter is now 1

please reload this page to increment

Example Code:

session_start();
session_register("count");

if (!isset($_SESSION)) 
{
	$_SESSION["count"] = 0;
	echo "<p>Counter initialized</p>\n";
} 
else { $_SESSION["count"]++; }

echo "<p>The counter is now <b>$_SESSION[count]</b></p>".
	"<p>please reload this page to increment</p>";

 

$Id: session_counter.php,v 1.3 2002/08/30 04:14:14 willn Exp $