本文整理汇总了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');
}