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 6 How to hide fileds on creating content but show on editing content?
Drupal 6 - creating full page content with no sidebars within
Node save with multiple taxonomy field of different vocabulary in drupal 6
Hybridauth module social network icons not working with user/register page drupal 6
Is there a way to make an online customer tax exempt?
How to put two form elements in a row using Drupal Form API?
Increase memory_limit of subdomains in the plesk panel
Cart items missing after login, drupal6 with ubercart
How to disable “Read more” link in product description? (ubercart, drupal6)
How to configure site created in drupal on some other machine to be run on localhost of another machine
How to have different style files in multilingual website using Drupal 6?
scrollable views in drupal 6 is needed
hook_comment is not working for update operation in drupal
Drupal 6 - Image gallery image popup when navigating site?
How to put two cck fields in add content page in drupal 6
drupal block variable_set not saving select value