Skip to content

Instantly share code, notes, and snippets.

@jesse1981
Created April 23, 2013 15:02
Show Gist options
  • Select an option

  • Save jesse1981/5444321 to your computer and use it in GitHub Desktop.

Select an option

Save jesse1981/5444321 to your computer and use it in GitHub Desktop.
Cross Domain Resource Sharing example
function isAllowedOrigin($origin) {
// your logic here
//...
return true;
}
if (($_SERVER["HTTP_ORIGIN"]=="http://www.yoursite.com.au") || (isAllowedOrigin($_SERVER["HTTP_ORIGIN"]))) {
header("Access-Control-Allow-Origin: *");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment