【发布时间】:2012-05-17 22:17:01
【问题描述】:
我正在开发的网站有一个奇怪的问题。
登录后,用户将被重定向以阅读许可协议。在这个名为 terms.php 的页面中,我有条件地显示一个确认按钮,如果用户已登录,该按钮将用户重定向到名为 agreed.php 的页面,否则:到 register.php。
奇怪的是只在 Firefox 中(安装了 firebug)。
登录后,terms.php 的表单将显示action="register.php"!而不是agreed.php,并且我所做的所有检查都表明该用户未登录。
另一个奇怪的事情是,如果我按 F5 刷新,它显示agreed.php!
它不会发生在 IE 和 Chrome 中。
知道这可能是什么吗?
function logged_in() {
return isset($_SESSION['USER_ID']);
}
function redirect_to( $location = NULL) {
if ($location != NULL) {
header("Location: {$location}");
exit;
}
}
login.php
if (shouldReadTerms())
redirect_to("terms.php");
terms.php
<?php if(logged_in()): ?>
<?php if (shouldReadTerms()): ?>
<form action="agreed.php" method="POST">
<?php endif; ?>
<br />
<br />
<button <?php if (!shouldReadTerms()) echo 'disabled'; ?>>I Agree </button>
<?php if (shouldReadTerms()): ?>
</form>
<?php endif; ?>
<br />
<br />
<?php else: ?>
<form action="register.php" method="POST">
<br />
<br />
<button>I Agree</button>
</form>
<?php endif; ?>
【问题讨论】:
-
Any idea what this might be?- 不是没有看到一些代码。 -
嗨,泰德,请你把代码贴出来