skip to Main Content

ajax request in codeigniter returning html code instead of redirecting – Jquery ajax

I've added a constructor in a class to check if some user is logged in. public function __construct() { parent::__construct(); $this->load->library('form_validation'); $this->load->library('encryption'); if (!$this->session->userdata('id') || $this->session->userdata('role') != 'CUSTOMER') { redirect('account/login'); } } Here's the ajax $.ajax({ type:'POST', url:'<?php echo base_url("cart/addToCart");…

VIEW QUESTION
Back To Top
Search