,所以我必須在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