[eluser]Unknown[/eluser]
Newbie to CI and MVC-style stuffs of this nature, I've tried to look for a answer, I really have, but I'm an idiot and wondering if anyone has any ideas. I'm trying to do something vaguely simple, take the input from a text box and have the value use able in a function the controller.
What's in the View
Code:
<?=form_open('blog/search');?>
<p><label for="number">Number 1:</label>
<input type="text" name="num1" value="<?php echo set_value('num1');?>" /></p>
<p><?php echo form_submit('submit','Submit'); ?></p>
</form>
And here's the Blog controller
Code:
class Blog extends Controller {
function Blog()
{
parent::Controller();
$this->load->helper('url');
$this->load->helper('form');
function search()
{
$n1 = $this->input->post('num1');
echo $n1;
print_r($_POST);
}
}
The plan down the line is to try and have multiple inputs to use to search against a database, but I'm at this point just trying to see if I can get one text input to pass through. When I try to print_r, I get a empty array. Removing the value in the text input gets me nothing either. If anyone has any ideas, I'm all ears.