How to receive post/get request in codeigniter

Im using

$this->input->post('name') ; to get a request posted to my url.Instead of post I need to access get as well.

Like in normal php its ,$_REQUEST is used.But what about in codeigniter standards,how is it possible?

Answers


It's outlined in the docs here: http://ellislab.com/codeigniter/user-guide/libraries/input.html

To grab data from the get you can use

$this->input->get('some_data', TRUE);

That looks for some_data in the query string, and will run is through XSS filtering to clean it from possible hack attempts

There's also a handy method to check both at the same time:

$this->input->get_post('some_data', TRUE);

"This function will search through both the post and get streams for data, looking first in post, and then in get"


Try this:

http://ellislab.com/codeigniter/user-guide/libraries/input.html

You will get all methods to fetch data.


Need Your Help

How to stop an AGI script when other party hangsup

java asterisk terminate agi

I have a Java program that originates a call to a client and, upon answer, connects it to an extension in the dialplan. That extension in turn runs an AGI script to do some interactions with the cl...

404 page not found using Django + react-router

javascript python django reactjs react-router

I am trying to use reactjs and react-router (1.x) with my Django application but I am having a hard time putting all this together. Here is the github project just incase I dont provide enough