Created
April 23, 2013 15:02
-
-
Save jesse1981/5444321 to your computer and use it in GitHub Desktop.
Cross Domain Resource Sharing example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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