Drupal: What is wrong with my base_path to my libraries folder
I get the following error: Warning: require_once(/libraries/recaptchalib.php): failed to open stream: No such file or directory in eval() (line 3 of /home3/quikappd/public_html/rulpon/modules/php/php.module(80) : eval()'d code). In drupal 6 I am attempting to add captcha to an old content type that has a php html form built into it. I add the captchalib file to the library folder in my drupal instance, but I keep getting the error message noted above. I have tried dirname, base_path and various other urls to get to the folder. What am I do wrong? This is what I had for base_path -> require_once(base_path().'libraries/recaptchalib.php'); then this for dirname -> require_once ( dirname(__FILE__) . '/libraries/recaptchalib.php'); then just straight url -> //require_once('decon.com/sites/all/libraries/recaptchalib.php');
According to base_path() doc, it returns an URL segment. For example, if the drupal site homepage is on http://www.example.com/foobar, it would return /foobar That's why it doesn't help in locating an include file with php. When knowing where the file is relative to document root, you may use: require_once($_SERVER['DOCUMENT_ROOT']."/site/all/libraries/recaptchalib.php"); Or if the file is part of a module, a better method is be to locate it through: drupal_get_path('module', 'name-of-module')
Drupal, where I can find info about current active theme?
How to get to the admin page in Drupal
Drupal, where is edit account tab in user profile
Display new module in site
Showing a single node and all associated comments in Drupal 6 Views 2
Drupal Login page
Theming a field in Drupal-6
Viewing articles that are associated with taxonomy term A (AND) term B in Drupal 6
Drupal 6. Content Profile
Secondary Links in Blocks in Drupal 6
Is there a module that handles meta tags?
How do I get the results of a view and store them in a php var?
How do I set up my first view with Draggable Views module?
Two forms on the same page drupal
how to access cck checkbox value from views .tpl