redirect()在codeigniter 3.0和php 7.2.3 lampp服务器中不起作用

问题描述 投票:1回答:1

routes.php

$route['default_controller'] = 'login';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

autoload.php

$autoload['helper'] = array('url', 'file','form','html');

控制器:login.php

if ($this->form_validation->run() == TRUE) {
        if ($this->auth->login($login, $password, $remember_me)) {
              //echo site_url().'dashboard/index';
              //print_r($this->session->userdata());
              //die;
              redirect(site_url().'dashboard/index');
              //header('Location: /someurl.php');
              //$this->load->view('template/index');
        } else {
        $this->data['error_message'] = 'The username or password you entered is incorrect.';
        }
}

此代码在php-5.6 xampp服务器(os:windows)中正常工作。

但是在php-7.2.3 lampp服务器(os:ubuntu)中不起作用。

login()方法设置会话数据和returns true。但是redirect()方法无法重定向。当我设置redirect('https://facebook.com')时它起作用。

xampp和lampp有什么区别?为什么重定向方法在php-7.2.3 lampp服务器(ubuntu)中不起作用?

php ubuntu-16.04 codeigniter-3 lampp
1个回答
0
投票

是否有上述问题的最新消息?我面临与上述相同的问题。

请尽快回复。

© www.soinside.com 2019 - 2024. All rights reserved.