Class Back extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->library('session');
$this->load->helper('url');
}
public function _output()
{
$user = $this->session->userdata('username');
if(!$user)
{
echo "<script>alert('您还没有登录,请先登录!');</script>";
echo "<script>location.href = '".site_url('admin.php/index/index')."'</script>";
//redirect('admin.php/index/index', 'location', 301);
}else
{
echo "11";
}
}
public function index()
{
$user = $this->session->userdata('username');
echo "欢迎您回来:".$user;
$this ->load ->view("backindex");
}
}
这里我用_output()来检查用户是否登录了,但是检查完之后为什么
$this ->load ->view("backindex")不能执行了???? |