I defined a variable in PHP
define("SOMETHING","Something text");
Then I have a PHP file (defined.php):
echo SOMETHING;
And my jQuery $.get request is:
$.ajax({
type: "GET",
url: "/include/defined.php",
async: false,
success : function(text)
{
response = text;
}
});
I want to get in variable response "Something text" and not SOMETHING! Is there a way to do so?
Thank you so much :)
You have a scope error: SOMETHING is not defined at the moment of the echo call.
Maybe you forgot to include the file with your defined.php?