search_form_submit

Definition

search_form_submit($form_id, $form_values)
modules/search/search.module, line 1022

Description

Process a search form submission.

Related topics

Namesort iconDescription
Search interfaceThe Drupal search interface manages a global search mechanism.

Code

<?php
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;
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.