[eluser]osama[/eluser]
Hi, friends
i have two simple pages admin_check.php and dashboard.php
I'm using the admin check file to protect my admin pages so i put a very simple code in it to know if the user logged in or not then I'm using this file ( admin_check) in other files to do the log in check process but it's not working when i require it in other files
This is admin_check code :
Code:
<?php
class Admin_check extends CI_Controller {
function index()
{
if (!$this->tank_auth->is_logged_in()) {
redirect('/auth/login/');
} else {
$user_id = $this->tank_auth->get_user_id();
$username = $this->tank_auth->get_username();
echo"Welcome ". $username ." Your ID is ". $user_id ." .";
}
}
}
?>
and This is The dashboard Code :
Code:
<?php
require("admin_check.php");
class Dashboard extends CI_Controller {
public function index()
{
echo"<h2> Here Are DashBoard !</h2>";
}
?>
Logically When i go to htttp://localhost/codeigniter/index.php/dashboard
it should redirect me to log in page
But it doesn't so I'm Wondering what's Wrong ?:coolsmirk: