本文整理汇总了PHP中DBAccess::recordLogin方法的典型用法代码示例。如果您正苦于以下问题:PHP DBAccess::recordLogin方法的具体用法?PHP DBAccess::recordLogin怎么用?PHP DBAccess::recordLogin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBAccess
的用法示例。
在下文中一共展示了DBAccess::recordLogin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
* Verify Details
*/
$IP = $_SERVER['REMOTE_ADDR'];
$browser = $_SERVER['HTTP_USER_AGENT'];
$response = DBAccess::verifyUser($userName, $password, $IP, $browser);
if ($response == -1) {
$feedBack = "YOUR ACCOUNT HAS BEEN DISABLED";
} else {
if ($response > 0) {
$details = DBAccess::getUserByUserID($response);
// store session data
$_SESSION['userID'] = $response;
$IP = $_SERVER['REMOTE_ADDR'];
$browser = $_SERVER['HTTP_USER_AGENT'];
//record login
DBAccess::recordLogin($response, $IP, $browser);
//redirect based on permission
if ($details[0]['Position'] == 1) {
header('Location: /admin/');
} elseif ($details[0]['Position'] == 2) {
header('Location: /');
} else {
header('Location: /index.php');
}
} else {
$feedBack = "Invalid username or password";
}
}
}
$title = "Login";
$head = "";