美好的一天,我需要一些新鲜的眼睛....我已经建立了一个登录系统,除了记住我的功能之外,它的工作非常完美......如果我不检查记住我的网站行为,这是怎么回事因为它应该...如果我检查记住我在这里是什么发生它登录并让我登录但如果我点击退出它退出但但如果我尝试重新登录它说页面无法显示..
在个人资料页面的登录页面上我必须删除cookie才能再次运行
logout.php代码
<?php include($_SERVER['DOCUMENT_ROOT'] . '/mysite/modules/int.php');
session_destroy();
if(isset($_COOKIE['email'])) {
unset($_COOKIE['email']);
setcookie('email', '', time()-86400);
}
redirect("index.php");
int.php代码
<?php
ob_start();
session_start();
include 'db_config.php';
include 'functions.php';
if ($connection) {
//echo "Database Connected";
}
?>
登录时记住我
function login_user($email, $password, $remember)
{
$sql = "SELECT user_pwd, uid FROM users WHERE user_email = '" . escape($email) . "' AND active = 1";
$result = query($sql);
if (row_count($result) == 1) {
$row = fetch_array($result);
$db_password = $row['user_pwd'];
if (password_verify($password, $db_password)) {
if ($remember == "on") {
setcookie('email', $email, time() + 86400);
}
$_SESSION['email'] = $email;
return true;
} else {
return false;
}
return true;
} else {
return false;
}
}