,所以我必须在php
如何将我去制作上php
一个函数来检查,如果有人也在网上可以将其在php
如何检查是否有人在线?
登录系统
<?php
if (empty($_POST) === false) {
$username = $_POST['username'];
$password = $_POST['password'];
if (empty($username) === true || empty($password) === true) {
$errors[] = 'Please Enter a username and password';
} else if (user_exists($username) === false) {
$errors[] ='Sorry but the user you entered dose not exist';
} else if (user_active($username) === false) {
$errors[] ='You have not activated your account please check your email to activate your account';
} else {
if (strlen($password) > 32){
$errors[] ='Passwords to long !';
}
$login = login($username, $password);
if ($login === false) {
$errors[] ='incorrect username or password';
} else {
$_SESSION['user_id'] = $login;
header('Location: index.php');
exit();
}
}
} else {
$errors[] = 'No information received';
}
echo output_errors($errors);
?>
检查该用户的会话是否存在。 – 2014-10-11 17:00:07
当任何用户登录设置标志在数据库中激活,然后进行数据库调用来获取所有在数据库中有活动标志的用户。 – 2014-10-11 17:05:53
@Azam alvi谢谢你的回应,但我试过了,它似乎比我的回答更复杂 – KillerDucky1 2014-10-11 17:13:01