function drupal_current_script_url

cis7 drupal_current_script_url($query = array())
cle7 drupal_current_script_url($query = array())
elmsmedia7 drupal_current_script_url($query = array())
icor7 drupal_current_script_url($query = array())
meedjum_blog7 drupal_current_script_url($query = array())
mooc7 drupal_current_script_url($query = array())

Returns the URL of the current script, with modified query parameters.

This function can be called by low-level scripts (such as install.php and update.php) and returns the URL of the current script. Existing query parameters are preserved by default, but new ones can optionally be merged in.

This function is used when the script must maintain certain query parameters over multiple page requests in order to work correctly. In such cases (for example, update.php, which requires the 'continue=1' parameter to remain in the URL throughout the update process if there are any requirement warnings that need to be bypassed), using this function to generate the URL for links to the next steps of the script ensures that the links will work correctly.


$query: (optional) An array of query parameters to merge in to the existing ones.

Return value

The URL of the current script, with query parameters modified by the passed-in $query. The URL is not sanitized, so it still needs to be run through check_url() if it will be used as an HTML attribute value.

See also


2 calls to drupal_current_script_url()
drupal_requirements_url in includes/
Returns a URL for proceeding to the next page after a requirements problem.
update_info_page in ./update.php
Provides an overview of the Drupal database update.


includes/, line 1060
API functions for installing modules and themes.


function drupal_current_script_url($query = array()) {
  $uri = $_SERVER['SCRIPT_NAME'];
  $query = array_merge(drupal_get_query_parameters(), $query);
  if (!empty($query)) {
    $uri .= '?' . drupal_http_build_query($query);
  return $uri;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.