• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ajax forbidden 403

#1
Hi at all , sorry for english , i have a problem with ajax in  this site 
http://preventivoamianto.altervista.org/...istrazione

i use ajax in several project but i cannot know why in this i haven't response :

i insert in config this: $config['csrf_exclude_uris'] = array('aziende/registrazione');


But i have not response.

This is the controller:

PHP Code:
     function get_province(){
            
            
        
$csrf  $this->security->get_csrf_hash();
        
$this->output
                  
->set_content_type('application/json')
                 
 ->set_output(json_encode(array( 'csrf' => $csrf)));
 
          
         
return  $this->location_model->get_province();
 
        
      



And this the model :
PHP Code:
function get_province(){
 
        
      $regioni_id
=$this->input->post('regione');
 
     
      $query 
$this->db->query("SELECT * FROM  province WHERE id_regione= $regioni_id  ORDER BY provincia asc");
 
     $res'<option value="" selected="selected">-- seleziona --</option>';
 
        foreach($query->result() as $province){
 
        
         $id
=$province->id;
 
        $provincia=$province->provincia;
 
        $res.= "<option value='$id'>$provincia</option>";
 
  
         
}
 
        
         
echo $res;
 
     
Reply

#2
you can use vardump to show the path you have to define and use an alert to check the response of your function. you can cross check by using Flag response in the console of Browser though which you can get the response at runtime.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.