02-08-2011, 01:07 PM
[eluser]ELRafael[/eluser]
Hy Guys,
My view. It's a simple search form
current_url() = http://site.local/news/index
My Controller (news, function index())
Result: Always bool(false)
The url "submited"
http://site.local/news/index?ci_csrf_tok...tuação&.....
My config.php
I'm using CodeIgniter 2.0 under MAMP enviroment
Can anyone help me?
Before any anwser, I know if I change the form's method to post and try to get the value using $this->input->post('search_term') will work fine.
But I really wanna use GET method, not POST. I still belive that POST method is for CHANGING ACTIONS (new user, edit data, ....)
Thanks a lot
Hy Guys,
My view. It's a simple search form
current_url() = http://site.local/news/index
Code:
<?php echo form_open( current_url(), 'method="get"' ); ?>
<input type="text" name="search_term" id="search_term" />
<input type="submit" value="Go Spider, GO!" />
</form>
My Controller (news, function index())
Code:
$search_term = $this->input->get('search_term');
var_dump($search_term);
Result: Always bool(false)
The url "submited"
http://site.local/news/index?ci_csrf_tok...tuação&.....
My config.php
Code:
$config['uri_protocol'] = "AUTO";
$config['enable_query_strings'] = FALSE;
I'm using CodeIgniter 2.0 under MAMP enviroment
Can anyone help me?
Before any anwser, I know if I change the form's method to post and try to get the value using $this->input->post('search_term') will work fine.
But I really wanna use GET method, not POST. I still belive that POST method is for CHANGING ACTIONS (new user, edit data, ....)
Thanks a lot
