Advertisement
Technical_13

Untitled

Feb 16th, 2014
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. $allowedIn = array("http://this.site.org", "https://this.site.org", "http://that.site.org", "https://that.site.org");
  2. if(in_array($_SERVER['HTTP_ORIGIN'], $allowedIn)){
  3.     $CORS = $allowedIn[array_search($_SERVER['HTTP_ORIGIN'], $allowedIn)];
  4.     header("Access-Control-Allow-Origin: " . $CORS);
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement