Jump to content

damian1923

New Members
  • Posts

    2
  • Joined

  • Last visited

damian1923's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I need send data between 2 domains: in domain1 (JQuery): //e.g. data = "name="+$name+"&email="+$email; $.ajax({ crossDomain : true, type: "POST", data: data, url: "domain2.com", success: function(html){ console.log('GTRS success!'); } }); in domain2 (PHP): <?php header("Access-Control-Allow-Methods: GET, POST, OPTIONS"); header("Access-Control-Allow-Credentials: true"); header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Headers: Content-Type, * "); // and my code ?> It work very well in all browsers excerpt MS IE, how to fix this problem? any idea?
  2. try this <?php $http_origin = $_SERVER['HTTP_ORIGIN']; if ($http_origin == "http://www.domain1.com" || $http_origin == "http://www.domain2.com" || $http_origin == "http://www.domain3.info") { header('Access-Control-Allow-Origin: *'); } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.