How to use drupal in scripts. Bootstrap and login programaticly.

Posted by: 
Dominique De Cooman

Create a file in the root of your drupal folder and put on top :

  require_once 'includes/bootstrap.inc';
  drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
  global $user;
  $user->uid = 1;

You can now use every drupal function within your drupal installation.

Add new comment