php - 页面没有重定向到 URL?
问题描述
我正在做PHP-CodeIgniter
项目。我正在使用ION Auth library
身份验证。
我的问题是当我将粘贴表数据复制到 Excel 工作表,然后单击复制到 Excel 的链接not properly redirect
到特定页面时。如果我hover mouse on the link it shows proper address
,但在点击它时,它redirects to Dashboard
不是particular page
,它们是一个Active session data
,但它只重定向到仪表板。
控制器代码:
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
class Auth extends CI_Controller
{
function __construct()
{
parent::__construct();
// $this->load->library('');
$this->load->model('Landlord_m', 'l');
}
public function index()
{
redirect('auth/login');
}
public function login()
{
if( $this->ion_auth->logged_in() ) redirect('dashboard');
$this->form_validation->set_rules('email', 'email', 'required|valid_email|trim');
$this->form_validation->set_rules('password', 'password', 'required|trim');
$this->form_validation->set_message('required', 'Please enter your %s');
// Validate form
if( $this->form_validation->run() )
{
$remember = (bool) $this->input->post('remember');
// Check login
if( $this->ion_auth->login($this->input->post('email'), $this->input->post('password'), $remember) )
{
// Login was successful
redirect('dashboard', 'refresh');
}
else
{
// Login was un-successful
$this->session->set_flashdata('message', $this->ion_auth->errors());
redirect('auth/login', 'refresh');
}
}
else
{
$data['message'] = $this->session->flashdata('message');
$this->load->view('auth/login', $data);
}
}
public function logout()
{
if( $this->ion_auth->logout() )
redirect('auth/login');
else
die("There was an error logging you out");
}
欢迎任何形式的帮助,在此先感谢。
解决方案
推荐阅读
- python - 为什么我的 DataGenerator 迭代的数据多于数据集的大小并给出 IndexError: list index out of range?
- angular - 动态更改角度 6 中的图标
- ansible - 在 kubernetes 命名空间中使用 ansible playbook 升级 helm
- django - Django 字段与多个抽象基类发生冲突
- c - 定时器触发 GPDMA 传输到 SRAM
- c# - 为什么字体被“包围”时不呈现在 HTML 中
- certificate - 使用自签名证书进行内核模式驱动程序签名
- reactjs - 在reactjs中提交之前无法更改状态值
- html - 无法设置动态创建的 .innerHTML (Angular)
- ssis - 尽管已将 -hostkey 开关添加到 WinSCP 命令行,但“主机密钥未验证”