Community Documentation

$base_path

  1. drupal
    1. 6 globals.php
    2. 7 globals.php
    3. 8 globals.php

The base path of the Drupal installation.

This will at least default to '/'.

See also

drupal_settings_initialize()

File

developer/globals.php, line 31
These are the global variables that Drupal uses.

Code

<?php
global $base_path
?>

Comments

You can always use $GLOBALS['base_path']

Important to note that GLOBALS is always available as an array.
So $base_path is always available as $GLOBALS['base_path'].

Also be careful as your database connection info is also in the GLOBALS array.

Login or register to post comments