I have the file.js file in the folder:
folder1\folder-xpto\js\c3-0.4.11\file.js
This file has the following script AJAX
:
$.ajax({
type : 'post',
url : 'controller/classX.php',
dataType : 'html',
data : {
var1 : 12,
varId : 87
},
beforeSend : function() {
},
complete : function() {
},
success : function(options) {
alert(options);
},
error : function(xhr, er) {
}
});
And I want to access the file classX.php
that is here:
folder1\folder2\classX.php
In the file classX.php
I have the following script to validate and get the value sent:
if (isset ( $_POST ['varId'] )) {
echo 'recebido';
// ...
}
I've tried several ways, putting './'
or '../'
, etc, in the URL, but I can not.
Does anyone know how I can do this?