哦买噶:What the hammer?

php ajax 跨域请求允许多个域名

2018-2-26 晦涩sunshine PHP学习笔记

php ajax 跨域请求允许多个域名 $origin = isset($_SERVER['HTTP_ORIGIN'])? $_SERVER['HTTP_ORIGIN'] : ''; $allow_origin = array( 'http://a.com', 'http://b.com' ); if(in_array($origin, $allow_origin)){ header('Access-Control-Allow-Origin:'.$origin); } header("Access-Control-All...

阅读全文>>

标签: php ajax 跨域

评论(0) 浏览(245)

Powered by emlog sitemap