I have created a search form that I want to forward on submit.
The way it should work is the user enters the term/keyword they want to search for, the form will then forward them to /search/$keyword
My research has let me to the conclusion that the form needs to be posted to the controller then do the forwarding from there. But I have tried numerous times and can't get it to forward.
Here is the form:
<?php echo form_open('search'); ?>
<input id="search_text" name="searchquery" type="text" value="enter your search here..." onfocus="if(this.value == 'enter your search here...') this.value='';" onblur="if(this.value == '') this.value='enter your search here...';" maxlength="120" >
<?php echo form_close();?>
And the controller:
if($this->input->post('searchquery')){
redirect('search', $this->input->post('searchquery'));
}