本文整理匯總了PHP中User_Controller::logout方法的典型用法代碼示例。如果您正苦於以下問題:PHP User_Controller::logout方法的具體用法?PHP User_Controller::logout怎麽用?PHP User_Controller::logout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類User_Controller
的用法示例。
在下文中一共展示了User_Controller::logout方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
<?php
/**
* Created by PhpStorm.
* User: Natnael Zeleke
* Date: 8/25/2015
* Time: 5:04 PM
*/
require "../CONFIGURATION/Config.php";
require DB;
require "../MODEL/User.php";
require "User_Controller.php";
require "Controller_Secure_Access.php";
session_start();
//if the user accessed the page with out permission it will be redirected to the home page
if (!isset($_SESSION['Logged_In_User'])) {
redirect_to_index();
} else {
$user = $_SESSION["Logged_In_User"];
$user_controller = new User_Controller($user);
$user_controller->logout();
redirect_to_index();
}