request_uri

Versions
4.6 – 7
request_uri()

Since request_uri() is only available on Apache, we generate an equivalent using other environment vars.

▾ 5 functions call request_uri()

form in includes/common.inc
Generate a form from a set of form elements.
locale in modules/locale.module
Provides interface translation services
page_get_cache in includes/bootstrap.inc
Retrieve the current page from the cache.
page_set_cache in includes/bootstrap.inc
Store the current page in the cache.
watchdog in includes/bootstrap.inc
Log a system message.

Code

includes/bootstrap.inc, line 543

<?php
function request_uri() {

  if (isset($_SERVER['REQUEST_URI'])) {
    $uri = $_SERVER['REQUEST_URI'];
  }
  else {
    if (isset($_SERVER['argv'])) {
      $uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['argv'][0];
    }
    else {
      $uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['QUERY_STRING'];
    }
  }

  return $uri;
}
?>
Login or register to post comments
 
 

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.