[eluser]johnmiller[/eluser]
the below is the code i wrote for search button.
Code:
<form id="search" method="post" action="../search/">
<input type="submit" name="button" id="button" value="Search" />
</form>
I have a function named 'search' in the controller (controller name is blog).
I call this function when the page loads because i need to get many values from database to this page (like state, city etc).
my search starts after that.
if i write action="../search/" in my button click, it will generate error.
so i thought of writing another function called do_search
and i wrote
Code:
<form id="search" method="post" action="../do_search/">
<input type="submit" name="button" id="button" value="Search" />
</form>
and in the controller i wrote
Code:
function do_search()
{
$this->load->view('search');
}
what i want is...
moving to do_search function, passing the values to model, returning the results, then loading search page with results.
but it gives me error.
how to do that correctly?