//controller user
function login()
{
if (FALSE == $this->session->userdata('history_page'))
{
$this->session->set_userdata('history_page', $_SERVER['HTTP_REFERER']);;
}
//表单验证部分
$this->load->helper('form');
//...
//跳转部分
if ($this->access_library->is_logged_in())
{
$this->Members_model->LastLoggedIn();
if ($this->session->userdata('history_page')) {
echo "<script language='javascript'>";
echo "location='".$this->session->userdata('history_page')."';";
echo "</script>";
$this->session->unset_userdata('history_page');
}
else
{
redirect('','refresh');
}
}
}