I have a page where user enters in the number of sessions(exams) they require (call this previous page). Now after the user submits this form it should start off with exam 1 on the next page (current page) e.g. if number of exams user wants is 4, then it should state 'Session 1 of 4'. Now 1 is $sessionMinus
and 4 is $_SESSION['inital_count']
. But instead for the first session(exam) stating session 1 of 4, it is stating 4 of 4. Why is this happening?
On current page code is below:
<?php
if ($sessionMinus = $_SESSION['initial_count']) {
$action = ($sessionMinus = $_SESSION['initial_count']) ? "create_session2.php" : $_SERVER['PHP_SELF'];
}
?>
<body>
<h1>SESSION (<?php echo $_SESSION['id'] ?>) <?php echo $sessionMinus ?> OF <?php echo $_SESSION['initial_count'] ?></h1>
<form id="QandA" action="<?php echo htmlentities($action); ?>" method="post" onsubmit="return validateForm(this);">
</form>
</body>