Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php preg_match html cross origin

$origin = $_SERVER['HTTP_ORIGIN'];
$allowed_domains = [
    'http://mysite1.com',
    'https://www.mysite2.com',
    'http://www.mysite2.com',
];

if (in_array($origin, $allowed_domains)) {
    header('Access-Control-Allow-Origin: ' . $origin);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #html #cross #origin
ADD COMMENT
Topic
Name
3+8 =