How can I call a Drupal function or get the global variable in a PHP file which is located under the drupal installation folder. I doing it for the first time. Are there any files I need to include in my code in order to access the Drupal function or variables?
4条回答 默认 最新
- douwulu2576 2011-06-29 14:18关注
Taken from the linked question in the comment above
You need to Bootstrap Drupal in the external PHP file:
/** bootstrap Drupal **/ chdir("/path/to/drupal/site/htdocs"); require_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
Be sure to change the path to your Drupal installation, then add your code below the code posted above.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报