create a new file "sessiontest.php" and put it on your webserver. Quit your browser.
Put this code into the "sessiontest.php":
Code: Select all
<?php
session_start();
if(isset($_GET["do"])) {
$_SESSION["test"]++;
header("Location: ".$_SERVER['PHP_SELF']);
}
?>
<html>
<head>
<title>Session Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
Click for <a href="sessiontest.php?do=<?php echo intval($_SESSION["test"]) ?>">loading</a> session test!
<?php echo (isset($_SESSION["test"])) ? "<br><br>session var is set (".$_SESSION["test"].")" : "no session set"; ?>
</body>
</html>
Oliver