function ferpa_waiver_search_form_submit($form, $form_values) { // Redirect to results page with submitted form values in the GET query portion of the URL. $query = array(); if (!empty($form_values['lastname'])) { // Trim any spaces off either side just in case the user is stilly. $query[] = 'lastname='.trim($form_values['lastname']); // The . adds two strings together, and .= works just like += for numbers. // $a .= $b is the same as $a = $a . $b } if (!empty($form_values['firstname'])) { $query[] = 'firstname='.trim($form_values['firstname']);  } if ($query) { // Only go to results if we have a query to send. $query = implode('&', $query); drupal_goto('ferpa_waiver/results', $query); // drupal_goto() exits the current page, so you cannot do anything after a call to drupal_goto(). } else { drupal_set_message(t('No search terms entered.')); // If you don't return any path in an _submit(), the form just refreshes. } }