This question already has an answer here:
function doit(user)
{
jQuery.ajax({
url:'http://www.xxxxxx.in/index.php',
type:'POST',
data:{id:user},
success:function(data){
if(data == "true")
{
//ileti("success","Done");
}
}
});
}
This is my index.php :
$user = $_REQUEST["id"];
Why is it that the value isn't passing?
</div>
You need to echo it out to return it to the AJAX function, and you might as well use $_POST,
echo $_REQUEST["id"]; // or
echo $_POST["id"];
Do some debugging. Try this :-
var_dump($_REQUEST);
and see what you get as output.
As a security measure, AJAX does not allow you to make requests to other domains. If you still want to make a call on other server then do something like this.
The simplest way is first call a function on your own server and from that page use some other method like CURL to fetch data from other server. Ajax to Different Server Using PHP