drupal-6


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')

Related Links

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?
calling of javascript function on button click in .module file in drupal
Two forms on the same page drupal
how to access cck checkbox value from views .tpl

Categories

HOME
bluetooth
image-processing
isabelle
tinymce
appx
electron
spring-jdbc
graphql
ckeditor
ravendb
portia
applepay
dacpac
reveal.js
nstableview
google-cloud-spanner
zend-framework3
windows-azure-storage
visual-studio-2005
jsprit
quartz-scheduler
django-simple-history
connection-string
ab-testing
alpine
jprofiler
autocad-plugin
captiveportal
jndi
p-value
opennlp
facebook-access-token
social-media
tasklet
http-status-code-503
functor
grails-3.1
mpmediaquery
catalog
host
event-driven
android-browser
uft-api
reportbuilder
leading-zero
squib
optix
reportingservices-2005
convertapi
angular-resource
fault
chain-builder
errordocument
paxos
domain-model
rdfs
typed-lambda-calculus
google-perftools
dtexec
mako
zendesk-app
arrow-keys
sqldf
xcb
setuptools
slicknav
thrust
storekit
contact-list
simplewebrtc
lua-5.1
bluemix-app-scan
revolution-r
tcpserver
execute
security-testing
coveralls
responsive-images
method-parameters
event-bubbling
graph-drawing
bridge.net
jsapi
tween
android-imagebutton
javafx-webengine
gulp-less
article
htmlcleaner
oracle-warehouse-builder
blending
eclipse-memory-analyzer
dataadapter
jquery-mobile-dialog
xamlparseexception
comaddin
interface-orientation
jelly
tinn-r
sublist
ticoredatasync
propagation
sef
eqatec

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App