Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
269 views
in Technique[技术] by (71.8m points)

php - How to fix status code 303 in codeigniter?

I am working on CI 3 when I post form data and insert into database then form a value that has been successfully save and I am also getting the last insert through $insert_id = $this->db->insert_id() following example as mention below:

$data = array(
    'name'  =>  $this->input->post('name'),
    'email' =>  $this->input->post('email'),
    'password'  =>  sha1($this->input->post('cpassword')),
    'confirm_id' => sha1($this->input->post('email')),
    'created_at' => date('Y-m-d H:i:s')
);
$success = $this->db->insert('instructor', $data);
$insert_id = $this->db->insert_id($success);
if($success == true)
{
    $instructorData = $this->instructor_m->get_instructorData($insert_id);
    $this->session->set_userdata('InstloginuserId',$instructorData->instructorID);
    redirect(base_url('board'));
}
else
{
    $this->session->set_flashdata('message', $this->lang->line('fail'));
    redirect(base_url('register'));
}

image

If success condition is true then it redirects to board page but it throws status code: 303 I don't know why? Please help me to solve this.

question from:https://stackoverflow.com/questions/65898406/how-to-fix-status-code-303-in-codeigniter

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The Session Library has been completely re-written in CodeIgniter 3 and now comes with a bunch of new features, but that also means that there are changes that you should make.

Read the Step 6: Update your Session library usage from CodeIgniter | Upgrading from 2.2.x to 3.0.x.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...