Modifying Session Variables
<?php
session_start();
session_register('access_count');
$access_count++;
if ($access_count==1) {
echo "the first time!";
} else {
$message="accessed this page $access_count times.";
}
?>
<html>
<head>
<title>Access Count</title>
</head>
<body>
<?php echo "$message"; ?>
</body>
</html>
Related examples in the same category