php后端跨域Header头

  • header("Access-Control-Allow-Origin: http://a.com"); // 允许a.com发起的跨域请求  
  • //如果需要设置允许所有域名发起的跨域请求,可以使用通配符 *  
  • header("Access-Control-Allow-Origin: *"); // 允许任意域名发起的跨域请求  
  • header('Access-Control-Allow-Headers: X-Requested-With,X_Requested_With'); 

 

 

以上并没有测试,敬请原谅!

posted @ 2017-05-27 16:52  fan-Y  阅读(17476)  评论(0编辑  收藏  举报