Include a PHP file located in the home directory in a module How can I include a PHP file located in my Drupal's home directory from a module?
Drupal 7 defines the constant DRUPAL_ROOT, which contains the name of the directory where Drupal is installed. It is used from Drupal functions, such as module_load_include() in a way similar to the following one:

if (function_exists('drupal_get_path')) {
  $file = DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "/$name.$type";
  if (is_file($file)) {
    require_once $file;
    return $file;
  }
}


In your case, you should use the following code:

require_once DRUPAL_ROOT . "/$filename";


The variable $filename contains the name of the file to load.