Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/243.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 重定向到另一页时出现Codeigniter内部服务器错误_Php_.htaccess_Codeigniter_Redirect - Fatal编程技术网

Php 重定向到另一页时出现Codeigniter内部服务器错误

Php 重定向到另一页时出现Codeigniter内部服务器错误,php,.htaccess,codeigniter,redirect,Php,.htaccess,Codeigniter,Redirect,我有以下功能,可以重定向到另一个关于成功的页面: public function process() { $username = $this->input->post('username'); $password = $this->input->post('password'); // Validate the user can login $result = $this->login_model

我有以下功能,可以重定向到另一个关于成功的页面:

public function process() {


        $username = $this->input->post('username');
        $password = $this->input->post('password');
        // Validate the user can login

        $result = $this->login_model->validate($username, $password);
        // Now we verify the result
        if (!$result) {

            if (empty($password)) {
                $msg = '<font color=red>Invalid username and/or password.</font><br />';
                $this->index($msg);
            } else {

                $msg = '<font color=red>Invalid username and/or password.</font><br />';
                $this->index($msg);
            }
        } else {
            // If user did validate, 
            // Send them to members area
            redirect('home');
        }
    }
有没有其他方法可以在codeigniter中执行重定向而不使用php重定向函数

确保索引函数接受传入参数

在控制器中

public function process() {

    $username = $this->input->post('username');
    $password = $this->input->post('password');

    $result = $this->login_model->validate($username, $password);

    if (isset($result)) { #change this

        if (empty($password)) {

            $msg = '<font color=red>Invalid username and/or password.</font><br />';
            $this->index($msg); # not sure about this
        } 
        else {

            $msg = '<font color=red>Invalid username and/or password.</font><br />';
            $this->index($msg); # not sure about this
        }
    } 
    else {

        redirect('home');
    }
}
公共职能流程(){
$username=$this->input->post('username');
$password=$this->input->post('password');
$result=$this->login\u model->validate($username,$password);
如果(isset($result)){#更改此项
if(空($password)){
$msg='无效的用户名和/或密码。
'; $this->index($msg)#对此不确定 } 否则{ $msg='无效的用户名和/或密码。
'; $this->index($msg)#对此不确定 } } 否则{ 重定向(“主页”); } }
确保索引函数接受传入参数

在控制器中

public function process() {

    $username = $this->input->post('username');
    $password = $this->input->post('password');

    $result = $this->login_model->validate($username, $password);

    if (isset($result)) { #change this

        if (empty($password)) {

            $msg = '<font color=red>Invalid username and/or password.</font><br />';
            $this->index($msg); # not sure about this
        } 
        else {

            $msg = '<font color=red>Invalid username and/or password.</font><br />';
            $this->index($msg); # not sure about this
        }
    } 
    else {

        redirect('home');
    }
}
公共职能流程(){
$username=$this->input->post('username');
$password=$this->input->post('password');
$result=$this->login\u model->validate($username,$password);
如果(isset($result)){#更改此项
if(空($password)){
$msg='无效的用户名和/或密码。
'; $this->index($msg)#对此不确定 } 否则{ $msg='无效的用户名和/或密码。
'; $this->index($msg)#对此不确定 } } 否则{ 重定向(“主页”); } }
是否检查了htaccess文件?是否检查了htaccess文件?