Welcome Guest, Not a member yet? Register   Sign In
input->get('var_name')
#1

[eluser]ELRafael[/eluser]
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...Acentuaçã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 Smile


Messages In This Thread
input->get('var_name') - by El Forum - 02-08-2011, 01:07 PM
input->get('var_name') - by El Forum - 02-08-2011, 02:03 PM
input->get('var_name') - by El Forum - 02-08-2011, 02:11 PM
input->get('var_name') - by El Forum - 02-08-2011, 02:46 PM
input->get('var_name') - by El Forum - 02-09-2011, 04:33 AM
input->get('var_name') - by El Forum - 02-09-2011, 08:02 AM
input->get('var_name') - by El Forum - 02-11-2011, 04:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB