Skip to content

Instantly share code, notes, and snippets.

@jovialcore
Created December 14, 2022 09:45
Show Gist options
  • Save jovialcore/3798d80f5d88f0e605e60b4b8b38a943 to your computer and use it in GitHub Desktop.
Save jovialcore/3798d80f5d88f0e605e60b4b8b38a943 to your computer and use it in GitHub Desktop.
<?php
//
$origin = $_SERVER['HTTP_ORIGIN'];
if ($origin == "http://www.domain1.com"
|| $origin == "http://www.domain2.com"
|| $origin == "http://www.domain3.com") {
header("Access-Control-Allow-Origin: $origin");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment