Definition

drupal_get_destination()
drupal-4-6/includes/common.inc, line 124

Description

Prepare a destination query string for use in combination with drupal_goto(). Used to direct the user back to the referring page after completing a form.

@see drupal_goto()

Code

function drupal_get_destination() {
  $destination[] = $_GET['q'];
  $params = array('from', 'sort', 'order');
  foreach ($params as $param) {
    if (isset($_GET[$param])) {
      $destination[] = "$param=". $_GET[$param];
    }
  }
  return 'destination='. urlencode(implode('&', $destination));
}