douzhanlai4671 2012-03-29 18:35
浏览 18

为什么会话(考试)不是从1开始

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>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 2024-五一综合模拟赛
    • ¥15 下图接收小电路,谁知道原理
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭