2017-01-20 10 views
1

codeigniter 및 ion auth를 사용하여 웹 응용 프로그램을 만들고 있습니다. codeigniter 웹 응용 프로그램에 이온 인증 통합없이 내 자동 완성 필드가 제대로 작동하지만 이온을 통합 할 때 authcomplete 기능이 작동을 멈추고 콘솔에 오류가 표시됩니다. 여기 codeigniter 및 ion_auth jquery가 작동하지 않는 상태로 자동 완성 ~ 500 (내부 서버 오류)

<script type="text/javascript"> 
     $(function(){ 
      $(document).on("keydown.autocomplete",".task",function(e){ 
       $(this).autocomplete({ 
        source : '<?php echo base_url();?>digital/search_field/task_search', 
       }); 
      }); 
     }); 
</script> 

내 컨트롤러 : 여기
GET link?term=l 500 (Internal Server Error) 

내 jQuery 코드입니다 좀 기사 구글에서 검색하면 여기
public function task_search(){ 
    if (!isset($_GET['term'])) 
    { 
     exit; 
    } 
    $qs = strtolower($this->input->get('term'));  
    $this->pojo->search_task($qs); 
} 

내 모델

public function search_task($qs){ 
    /*comparing data with the text box*/ 
    $query = $this->db->query("SELECT t_name FROM task_name WHERE t_name LIKE ('$qs%') ORDER BY t_name LIMIT 5"); 
    /* It checks the row in database table*/ 
    if($query->num_rows > 0) 
    { 
     foreach ($query->result_array() as $row) 
     { 
      $row_set[] = htmlentities(stripslashes($row['t_name'])); 
     } 
     echo json_encode($row_set); 
    }  
} 

입니다 csrf 문제라고합니다. CSRF에 대해 더 잘 알지 못해 해결책을 찾도록 도와주세요.

고맙습니다.

+0

누구든지 해결책을 찾도록 도와주세요. – xr33dx

답변

0

내 문제의 해결책을 찾았습니다. 문제는 내 모델에 있습니다. 여기 내 업데이트 된 모델입니다.

public function search_task($qs){ 
    /*comparing data with the text box*/ 
    $query = $this->db->query("SELECT t_name FROM task_name WHERE t_name LIKE ('$qs%') ORDER BY t_name LIMIT 5"); 
    /* It checks the row in database table*/ 
    if($query->result_id->num_rows > 0) 
     { 
     foreach ($query->result_array() as $row) 
       { 
       $row_set[] = htmlentities(stripslashes($row['t_name'])); 
       } 
      echo json_encode($row_set); 
     }  
    }