codeigniter issue with ajax post -


i'm trying ajax call 3 arguments controller gave me error missing argument 1 , 2 , 3, know codeigniter accept 1 argument tried add inside function:

$calibracao_data = $this->uri->segment(3); $user_a_drop = $this->uri->segment(4); $status = $this->uri->segment(5); 

but nothing worked, echo inside function variables , didn't success. changed config file: $config['permitted_uri_chars'] = 'a-z 0-9~%.:&_\-'; , nothing

the code of ajax:

<script> function get_active(calibracao_data, user_a_drop, ativo){     var fieldcal = $("input#calibracao_data").val();     var field1 = fieldcal.replace("/", "-");     var field2 = $("select#user_a_drop").val();     var field3 = ativo;     jquery.ajax({      url: "<?php echo base_url().'instrumentos/get_proximocal_cliente_status/'; ?>",     data: { field1: field1, field2: field2, get_status: field3 },     success: function(g) {          //alert (g);          $(".post_table").html(g);     },     error: function(xmlhttprequest, textstatus, errorthrown) {          alert("some error");     } }); }; 

and return console is:

http://localhost/apoio/app/instrumentos/get_proximocal_cliente_status/?field1=04-16&field2=75&get_status=ativo 

please help.

try with

$calibracao_data = $this->input->get('field1'); $user_a_drop = $this->input->get('field2'); $status = $this->input->get('field3'); 

or add method: "post", property ajax object.

don't change in config file such permitted chars parameter if can't realize consequences.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -