To clarify my question...
My plugin is/was using AJAX to call the file
pluginname/pluginname.php contains the usual plugin header and wordpress automatically finds it.
I'm trying to use the global
$wpdb in a plugin to insert data into one of my tables.
From the docs it sounds like I just need to include
However when I try to do so I'm getting an error.
PHP Fatal error: [
require()](function.require) : Failed opening required 'http://localhost:8888/blog/wp-blog-header.php' (include_path='.:/Applications/MAMP/bin/php/php5.3.6/lib/php') in /Applications/MAMP/htdocs/blog/wp-content/plugins/pluginname/submit/pick.php on line 4
pluginname/submit/pick.php (which is called by AJAX) has the following code
<?php $p = 'http://localhost:8888/blog/wp-blog-header.php'; echo $p; require($p); echo 'hi'; ?>
If I load the
pick.php, I see
http://localhost:8888/blog/wp-blog-header.php and that is it. So it must be failing on the require, as the error log confirms.
The path is correct as I inserted a quick echo into
wp-blog-header.php, and copy pasted the output from
pick.php into the address bar and it worked.
Any help would be appreciated.