i am sending a post request using jquery $.post to another domain. every thing works fine but i am not getting the posted data in the requested page please check my code
jquery code
var data = {mydata: 'testing'};
$.post("http://anyurl/file.php",data,function(info){
alert(info);
});
and here is php code
<?php
header('Access-Control-Allow-Origin: *'); // this is to allow another domain
$data = $_POST[“mydata”]; // assigning data to variable
echo $data; // sending back to jquery
?>
it does not return the data please check anyone.
Thanks in advance
$_POST[“mydata”]should have proper quotations like$_POST[''mydata]exes :)