我正在为我的网站创建一个登录系统,想知道是否有人可以帮助我解决问题?我希望那些已经登录到注册页面的人被重定向到您的帐户页面。
我已经尝试过了,但它似乎对我不起作用。
<?php
if (isset($_SESSION['id'])) { 
    header("location: youraccount"); 
} else {
    header("location: signup"); 
    exit();
} 
?>
经过一番折腾后,我设法做到了。
这就是最终对我有用的方法-
<?php 
if (isset($_SESSION['id'])) { 
    header('Location: youraccount?id=' . $userid . '');
    exit(); 
} 
?>