When I create a new script in a separate php file to run for Drupal, I need to add the following lines on top in order to access all Drupal APIs:
require_once \'./in
This should work for both Drupal 6 and Drupal 7 :
define('DRUPAL_ROOT', 'path/to/drupal');
chdir(DRUPAL_ROOT);
require './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
It doesn't matter where you put the script that contains this code. Just make sure you replace path/to/drupal
with the actual installation path of your Drupal system.