Json response and die combination in PHP

Member

titus

by titus , in category: PHP , 2 months ago

Json response and die combination in PHP 😁

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
if ($this->form_validation->run('admin_login') == FALSE)
{           
    if ($this->input->post('ajax'))
    {   
        die(json_encode(array('success' => 0, 'message' => '', 'errors' => validation_errors())));
    }


    $this->load->view('admin/login/index');
}


Facebook Twitter LinkedIn Telegram Whatsapp Pocket

no answers