Link to home
Start Free TrialLog in
Avatar of drl1
drl1Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Ajax post- Cross domain request XDR

This is my JavaScript code to make XDR post request:

if(isIE()) {
    xdr = new XDomainRequest();
    if (xdr) {
        xdr.onerror = err;
        xdr.ontimeout = timeo;
        xdr.onload = loadd;
        xdr.timeout = 10000;
        xdr.open('POST', url);
        xdr.send('myval=abc'); 
    } 
}

Open in new window


And when I try to access the variable myval in PHP:

if(isset($HTTP_RAW_POST_DATA)) {
  parse_str($HTTP_RAW_POST_DATA); // here you will get variable $myval
  if($myval== 'abc') {
  echo "TRUE !";
  }
}
else {
 echo 'NO POST DATA';
}

Open in new window


I get the output as 'NO POST DATA'. Could anyone help me in finding what is wrong here? Many thanks.
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
By the way, there's a PHP-specific forum area here that would better answer these types of questions in the future.