Title: WordPress functions aren&#8217;t being recognised by script
Last modified: August 19, 2016

---

# WordPress functions aren’t being recognised by script

 *  [amiga_os](https://wordpress.org/support/users/amiga_os/)
 * (@amiga_os)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/wordpress-functions-arent-being-recognised-by-script/)
 * From a particular page, I have a form that sends data to a JS, which then sends
   a $_POST request to a file called post.php
 * post.php accesses a database (a different database to the WP), and then outputs
   the data back to the JS script, which is then written to the screen.
 * It’s very simple AJAX talking to a server-side database.
 * I’m trying to use wpdb. The problem is that the post.php script doesn’t recognise
   WordPress functions. I’ve tried require() and require_once() with wp_config.php,
   wp_blog_header.php, and wp_load.php (this last one is recommended by the codex
   article on wpdb).
 * The require() isn’t throwing any errors, but the wordpress functions are still
   unrecognised.
 * Any help with this? Or any idea how I can interact with a database with JS in
   a let clumsy way? I found that WP would muck around with $_POST when I tried 
   to write this as a plugin. I need this finished by the weekend, and I’m scraping
   the barrel for any hack that will work. No longer have time to do it properly.

Viewing 1 replies (of 1 total)

 *  [Mark](https://wordpress.org/support/users/wpsec/)
 * (@wpsec)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/wordpress-functions-arent-being-recognised-by-script/#post-966829)
 * Sounds to me like the wp-config or wp-load files aren’t actually being loaded
   properly and your site might be set to not show PHP errors so you’re not seeing
   the error. Or you might not see the error because it’s being generated in the
   background and it’s not being passed back to frontend code that could display
   the error.
 * Double check the path to the file that you define. You either have to make it
   the full path (e.g. something like /home/myusername/blog/wp-config.php) or a 
   relative path (e.g. ../../../wp-config.php)

Viewing 1 replies (of 1 total)

The topic ‘WordPress functions aren’t being recognised by script’ is closed to new
replies.

 * 1 reply
 * 2 participants
 * Last reply from: [Mark](https://wordpress.org/support/users/wpsec/)
 * Last activity: [17 years, 4 months ago](https://wordpress.org/support/topic/wordpress-functions-arent-being-recognised-by-script/#post-966829)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
