<?php
session_start();
include('../includes/header.php');
if (!isset($_GET['step'])) {$_SESSION['num'] = 0;}
if (isset($_GET['step'])) {$_SESSION['num']++;}
if ($_SESSION['num'] > 5) {$_SESSION['num'] = 0;}
?>
<form>
<input type="hidden" name="step" value="0">
<input type="submit" value="Increment">
</form>
<form action="pstate/state.php" method="post">
<input type="submit" value="to SESSION example">
</form>
<?php
$i = 1;
while ($i < $_SESSION['num']) {echo $i; $i++;}
echo("<h3>{$_SESSION['num']}</h3>");
include('../includes/footer.php');
?>