function search_form_submit

7.x search.pages.inc search_form_submit($form, &$form_state)
6.x search.pages.inc search_form_submit($form, &$form_state)

Process a search form submission.

File

drupal-6.x/modules/search/search.pages.inc, line 119
User page callbacks for the search module.

Code

function search_form_submit($form, &$form_state) {
  $keys = $form_state['values']['processed_keys'];
  if ($keys == '') {
    form_set_error('keys', t('Please enter some keywords.'));
    // Fall through to the drupal_goto() call.
  }

  $type = $form_state['values']['module'] ? $form_state['values']['module'] : 'node';
  $form_state['redirect'] = 'search/' . $type . '/' . $keys;
  return;
}