Data in mysql is set to 0 when send a POST using network tab, codeigniter

51 views Asked by At

When I Edit and resend the request body using POST in Mozilla network tab, it corrupts my database table.

I couldn't understand why it is happening. Is this security related as anyone can open header and edit it, which is a very big security loophole.

Update function

function update()
{   
    if (!$this->tank_auth->is_logged_in()) {
        redirect('/auth/login/');
    } else{
        $userId = $this->session->userdata('user_id');
        $data = array(
            's_name' => $this->input->post('Name'),
            's_email' => $this->input->post('Email'),
            'slug' => $this->input->post('slug'),
        );

        $this->load->model('account_model'); 
        if($this->account_model->update($data,$userId))
        {
           redirect(site_url('account'));
        }
        else
        {
            echo "unsuccess";
        }
    }
}
0

There are 0 answers