How to catch variable from classic url in codeigniter |
[eluser]redraw[/eluser]
yesterday i have found autocomplete plugin from : http://browse.feedreader.com/c/Humorous_...g/40643578 view : Code: $("#baja").autocomplete("<?php echo base_url();?>index.php/personalia/edit_baja/", { from that ajax script on view generate url like this : Code: GET http://localhost/rsmp/index.php/personalia/edit_baja/?q=d&limit=10×tamp=1372750581577 controller : Code: Public function edit_baja() the problem is the codeigniter cannot catch the 'q' value. so $q in query value is null. how to fix it thank you
[eluser]alexwenzel[/eluser]
For GET variables use: $this->post->get() Look in the documentation for the input class section.
[eluser]redraw[/eluser]
[quote author="alexwenzel" date="1372752424"]For GET variables use: $this->post->get() Look in the documentation for the input class section. [/quote] thanks for the quick reply. but i still cannot get the value of 'q' even i already change to: Code: $q = $this->input->get($q, true)
[eluser]alexwenzel[/eluser]
look at documentation ^^ http://ellislab.com/codeigniter/user-gui...input.html Code: $q = $this->input->get('q');
[eluser]redraw[/eluser]
[quote author="alexwenzel" date="1372754796"]look at documentation ^^ http://ellislab.com/codeigniter/user-gui...input.html Code: $q = $this->input->get('q'); [/quote] still cannot catch the value of 'q'. I already try like you tell : Code: $q = $this->input->get('q');
[eluser]Pert[/eluser]
You have to allow GET from application/config.php file Code: $config['allow_get_array'] = true; There's some description on how it works above it in the configuration file.
[eluser]alexwenzel[/eluser]
[quote author="Pert" date="1372759081"]You have to allow GET from application/config.php file Code: $config['allow_get_array'] = true; There's some description on how it works above it in the configuration file.[/quote] You are so right. Isn't it allowed by default?
[eluser]Pert[/eluser]
I haven't changed my settings for GET, and it was set to false - so it must be default setting. This is probably because GET is just invitation to mess about with variables on URL.
[eluser]redraw[/eluser]
[quote author="Pert" date="1372759081"]You have to allow GET from application/config.php file Code: $config['allow_get_array'] = true; There's some description on how it works above it in the configuration file.[/quote] i add your code to my config.php but still cannot get the value of 'q' :down: its value of q still empty. thanks
[eluser]Pert[/eluser]
There's already section for it, change that section. If you put your variable in too early, it will be overwritten by existing FALSE setting. |
Welcome Guest, Not a member yet? Register Sign In |