Why status code 303 when redirecting through controller

384 Views Asked by At

I need to get the code error free but here the status code is showing as 303 and it says "see more". The preview and response also say "Failed to load response data".

When the redirect line is removed, status code is shown as 200.

Given below is my controllers function.

public function sendmail()
{
    $config = array(
        // config data
    );

    $this->email->initialize($config);

    $senderEmail = $this->input->post('senderEmail');
    $senderName = $this->input->post('senderName');
    $content = $this->input->post('emailcont');


    if ($this->emailModel->sendmail($senderEmail, $senderName, $content)) {
        $this->session->set_flashdata("email_sent","Email sent successfully.");  
        redirect('AboutController');
    }
    else {
        $this->session->set_flashdata("email_sent","Error in sending Email.");
    }       
}

Any reason why this is happening?

1

There are 1 best solutions below

4
On
You should have to use the function name also .You have to provide 
AboutController's 
function name where you want to redirect .
Try :
redirect('AboutController/function_name');
But Please make sure that you are using atleast codeigniter version 3.0