![]() |
The input->get is not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: The input->get is not working (/showthread.php?tid=17710) Pages:
1
2
|
The input->get is not working - El Forum - 04-13-2009 [eluser]tlam[/eluser] I'm currently in a controller called hello which looks like the following from the url: localhost/hello?id=123 Code: function hello() After accessing the above url, the id 123 is not displayed. Am I missing something? The input->get is not working - El Forum - 04-13-2009 [eluser]rakesh[/eluser] Since CodeIgniter does not utilize GET strings, its security filter function destroys the global GET array. The input->get is not working - El Forum - 04-13-2009 [eluser]tlam[/eluser] Does it mean that the following function from the doc(http://ellislab.com/codeigniter/user-guide/libraries/input.html) is invalid: Code: $this->input->get() I'm also assuming that the CI web site is using the CI framework. In my email notification, if I want to stop receiving notifications on a specific topic, it gives me a link similar to: http://codeigniter.com/?ACT=123&id=456abc&board_id=3 Can someone tell me how the above is currently processed from CI? The input->get is not working - El Forum - 04-13-2009 [eluser]TheFuzzy0ne[/eluser] Have you enabled query strings in your config.php? That should allow $this->input->get() to work. The input->get is not working - El Forum - 04-13-2009 [eluser]tlam[/eluser] I have it enabled: Code: $config['enable_query_strings'] = TRUE; but it's still not working for me. The input->get is not working - El Forum - 04-13-2009 [eluser]TheFuzzy0ne[/eluser] Try changing your URI protocol (again, in the config.php). Try each of the options in there, and see if that helps. The input->get is not working - El Forum - 04-13-2009 [eluser]tlam[/eluser] It's not working, it's making it more complicated, I will stick with CI's recommended way of using URI segments. The input->get is not working - El Forum - 04-13-2009 [eluser]TheFuzzy0ne[/eluser] Assuming you're using a Windows machine for development, setting the URI protocol to either REQUEST_URI or QUERY_STRING should work. For those times when you need to flexibility of query strings, I've created a library to help. It's not a replacement for query strings, though. It's only for those times that you need the flexibility of query strings, i.e. when you need to pass several parameters over the URI that aren't in a predefined order. http://ellislab.com/forums/viewthread/106502/#551143 The input->get is not working - El Forum - 04-13-2009 [eluser]TheFuzzy0ne[/eluser] Oh, and one more thing. This Web site is running Expression Engine, not CodeIgniter. Expression Engine is supposed to be moving over to using CodeIgniter, but I'm not sure when that's supposed to happen. To my understanding they are having trouble with integration. I also noticed that you were not calling your controller/methods properly. This is how to call a method in your controller using query strings: Code: your_website.com/?c=controller_name&m=method_name&arg1=something&arg2=something_else # and so on... Sorry for not spotting that previously. The input->get is not working - El Forum - 04-13-2009 [eluser]tlam[/eluser] Can I get some clarifications on the c and m, let's say I have the follow controller class: Code: class Greet extends Controller The url I am trying to access is: Code: localhost/greet/hello/?c=Greet&m=hello&id=123 After accessing the above, it should show 123 only on the page. Am I understanding it correctly? |