Pastoid

The page you are looking at now is at this URL: http://pastoid.com/amn

This paste was last updated on February 6, 2009 at 1:30 pm.

Pasted Coderaw

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 = '';
  if (!empty($form_values['lastname']) && !empty($form_values['firstname'])) {
    // Trim any spaces off either side just in case the user is stilly.
    $query[] = 'lastname='.trim($form_values['lastname']);
    $query[] = 'firstname='.trim($form_values['firstname']);
    // The . adds two strings together, and .= works just like += for numbers.
    // $a .= $b is the same as $a = $a . $b
  }
  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.
  }
}

Toggle wordwrap

Referring DomainHits
Unknown Referer 127
pastoid.com 7
search.live.com 2
Is this paste spam?
<Hide