Codigniter框架使用jquery+ajax/">jquery ajax代码如下:
ajax提交到home控制器代码:
代码如下 |
复制代码 |
#提交到本地
function ajax_check_username(){
//redirect('home/index');
$username = $this->input->post("username");
$salary_no = $this->input->post("salary_no");
if($this->user_mdl->check_ajax_user($username,$salary_no)){
$this->session->set_userdata('salary_no', $salary_no);
$this->session->set_userdata('username', $username);
echo "yes";
}else{
echo "no";
}
}
|