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?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
If the above explained example doesn't work try this:
The above code works for me, when the script is in my Drupal root directory. This loads absolutely everything, not just Drupal core, including contributed module hooks.
Taken from the linked question in the comment above
You need to Bootstrap Drupal in the external PHP file:
Be sure to change the path to your Drupal installation, then add your code below the code posted above.