Same name and namespace in other branches
  1. 4.7.x modules/search.module \search_form_submit()
  2. 6.x modules/search/search.pages.inc \search_form_submit()
  3. 7.x modules/search/search.pages.inc \search_form_submit()

Process a search form submission.

Related topics

File

modules/search/search.module, line 1022
Enables site-wide keyword searching.

Code

function search_form_submit($form_id, $form_values) {
  $keys = $form_values['processed_keys'];
  if ($keys == '') {
    form_set_error('keys', t('Please enter some keywords.'));

    // Fall through to the drupal_goto() call.
  }
  $type = $form_values['module'] ? $form_values['module'] : 'node';
  return 'search/' . $type . '/' . $keys;
}