Drupal 7: Variables in external file access Im having a tough time accessing variables from my own external file.

I gave this file:

?php include_once('/exercise_names.php'); ?

Which contains the following:

 ?php 

//Exercise Names

$memory01 = '1'; 
$memory02 = '2';
$memory03 = '3';
$memory04 = '4';

? 

I cannot get the page to render the names.  I keep getting the following errors:

Notice: Undefined variable: memory01 in eval() (line 4 of /home/webapps/drupal/releases/modules/php/php.module(80) : eval()'d code).

Basically its telling me it cant find the required variables, but they are in the file.  For some reason it cannot read the included file.

Any ideas?

thanks, Mac
If I have a module called foo, I put all of my includes in a subdirectory called 'inc/' and then use this

&lt;?php

require_once(dirname(__FILE__) . "/inc/constants.inc");
require_once(dirname(__FILE__) . "/inc/class.FOO.inc");
require_once(dirname(__FILE__) . "/inc/class.BAR.inc");


in foo.module.  If doing Drupal 7, you may also want to take a look at the files directive for .info files:


  Drupal now supports a dynamic-loading code registry. To support it,
  all modules must now declare any code files containing class or
  interface declarations in the .info file, like so:

files[] = example.test

  
  When a module is enabled, Drupal will rescan all declared files and
  index all the classes and interfaces that it finds. Classes will be
  loaded automatically by PHP when they are first accessed.


EDIT TO ADDRESS COMMENT

Even if you aren't doing this in a module, you should really abstract out the constants into a module that provides getter functions and/or a static class and/or a singleton with getter functions.

Another option is to bail on includes, and use variable_set / variable_get, preferably in conjunction with a module settings form.