Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

287
Views
Not getting data from jquery in codeigniter controller

500Getting Error like 500 (Internal Server Error)

jquery-3.6.0.js:10109 POST http://localhost/Banner_module/public/index.php/delete 500 (Internal Server Error)

HTML code:

<td>
  <button
    type="button" 
    value="<?= $row['bid'];?>" 
    class="cd btn btn-outline-danger"
  >Delete</button>
</td>

jquery Code:

$.ajax({
          type: "POST",
          url: "<?= site_url('delete') ?>",
           data: {"bid": bid}
         })

Routes :

$routes->post('delete','Home::delete');

controller:

public function delete(){

    

$user = new Bmodel();

    //$bid = $this->input->post('uid',true);
    $bid = $this->input->post('bid');
 
    // $data = array(
    //     'uid'  => $this->input->post('uid')
    //     );
    // $uid= json_encode($data);

    $data['user'] = $user->where('bid', $bid)->delete($bid);
   
    $response = ['status'=> "Deleted", 'status_text'=>'Deleted','status_icon'=>'success'];
    return $this->response->setJSON($response);
       }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!