I have a javascript file that is trying to send POST data to a php file that is in a directory above it in my filesystem:
plugin
|js
/script.js
|saveData.php
script.js:
$.ajax({
type: "POST",
url: '/../saveData.php',
data: {
obj
}, //send data if needed
success:function(){
alert("OK sent data!");
}
This however, doesn't seem to work. How should I be referencing this file? I am also a little bit confused as to where this php file should reside to begin - I need to be able to make calls to the $wpdb class. Any help/advice appreciated!