Hi All
I am developing a module and I have a question regarding hook_menu and form_state['redirect']
I have the following function
function people_search_block_form_submit($form, &$form_state) {
$form_state['redirect'] = 'people_search/'. implode(' ', $form_state['values']['keys']);
}
This redirects to a url that looks like http:site/people_search/term xyz xyz xyz
I have a menu callback that looks like this
function people_search_menu() {
$items['people_search/%'] = array(
'title' => t('Find a Person'),
'page callback' => 'people_search_output',
'page arguments' => array(1),
'access arguments' => array('access content'),
);
return $items;
}
As I understand the callback array(1) contains the value created by implode(' ', $form_state['values']['keys'])
The form_state values and keys come from a form and consist of a search term and the values from 3 select lists. I understand how the URL is getting the people_search/term xyz xyz xyz
From a usability point of view the URL with the xyz xyz xyz on the end of it looks terrible even though it has no effect on the operation of the script. The values are needed to be passed on to my code later on.