本文整理匯總了PHP中USER::logout方法的典型用法代碼示例。如果您正苦於以下問題:PHP USER::logout方法的具體用法?PHP USER::logout怎麽用?PHP USER::logout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類USER
的用法示例。
在下文中一共展示了USER::logout方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: redirect
if (USER::login($_POST['username'], $_POST['password'])) {
TPL::message("Perfect! You'll be redirected in 2 seconds..", "success");
redirect(isset($_GET['redirect']) ? urldecode($_GET['redirect']) : LINKS::get("admin_home"), 2);
} else {
switch (LOGS::get_error()['log_text']) {
case "wrong_username":
TPL::message("You entered a wrong username..");
break;
case "wrong_password":
TPL::message("You entered a wrong password..");
break;
}
}
}
// set render
TPL::render("v_login/login");
break;
/*
* logout user
*/
/*
* logout user
*/
case "logout":
// sign out user
USER::logout();
// redirect
redirect(LINKS::get("admin_login"));
break;
}
}
示例2: USER
<?php
require_once 'class.user.php';
require_once 'dbconfig.php';
require_once 'class.crud.php';
Session_start();
$user_login = new USER();
$user_login->logout();
示例3: USER
<?php
session_start();
require_once 'classes/class.user.php';
$user = new USER();
$user->logout();
$user->redirect('changepass.php');
示例4: USER
<?php
require_once 'php/session.php';
require_once 'php/user.php';
//new user object
$user_logout = new USER($conn);
//if user login has a session redirects to index
if ($user_logout->loggedin() != "") {
$user_logout->redirect('index');
}
//if the session and url gets logout then logout and redirect
if (isset($_GET['logout']) && $_GET['logout'] == "true") {
$user_logout->logout();
$user_logout->redirect('index.php');
}