I'm currently working on a custom search function for a module I'm building. The problem I'm having is that I need to pass the $_POST[edit] information to the command line and I can't figure out how. The reason I need to do this is as follows:
Here is my logic.
Search form takes text field and checkmarks (author, title, contents). When submit is called it goes to the URL "/mymodule/search." When that URL is accessed it grabs the $_POST[edit] array and passes it to a search function which then queries the database and spits out results.... until I want to go to page 2.
Since my search functions are entirely internal when I click on page 2 of the pager I am told that there are no results. This is happening because the search function is being run, but no POSTDATA exists anymore.
So what I need is to figure out a way to get the post data into the URL right away.
here is the search form I have right now:
function mymodule_search_form {
$form = form_textfield(t('Search String'), 'search_string', NULL, 70, 255);
$form .= form_checkboxes(t('Search Options'), 'search_options', NULL, array(t('Author'), t('Title'), t('Contents'))). form_submit(t('Submit'));;
$output = form($form, 'post', url('mymodule/search/'));
return $output;
Is there a way for me to get the results from the text field and checkboxes into the $output? I'd prefer for the url in the output to be like this: url('mymodule/search/012/search_string'). (FYI, "012" is just a representation of the checkbox array. I can take care of converting it to a text string myself, so don't worry about explaining that one).