我正在为我的计算机科学课做一个logoquiz,并且我正在忙于使用帐户名和电子邮件地址注册用户。 成功注册后,人们将被重定向到index.php用于在页面间保存变量的会话
在页面被重定向到,有一个绿色框表示注册完成,并给他们进一步的指示。
测试时,我每次访问index.php时,都会在电子邮件和用户名中没有任何提示。
<!--- Notice itself --->
<?php
session_start();
if(isset($_SESSION)){
$email = $_SESSION["email"];
$username = $_SESSION["username"];
?>
<!--- Green box that pops up --->
<div class="notice success"><i class="icon-ok icon-large"></i> Je registratie is succesvol verzonden <?php echo $username;?><br>
Er is een email verzonden naar <?php echo $email; ?>.<br>
Volg de instucties in deze mail om te kunnen beginnen<a href="#close" class="icon-remove"></a></div>
<?php
session_destroy();
} ?>
在寄存器页本身(RegSpelers.php),这个码被用于
<?php }elseif($wrong == FALSE && !empty($_POST)){
// After checking for wrong entered field or nothing at all use session.
$_SESSION["email"] = $email;
$_SESSION["username"] = $username;
header ('Location: index.php');
} ?>
'在注册页面你有一个'在session_start()? – 2013-12-24 00:15:16