您好,欢迎访问一九零五行业门户网

php如何设置允许跨域请求

php如何设置允许跨域请求?
在php文件头部加入
header(“access-control-allow-origin: *”);
如果想设置只允许某个网站通过的话可以这样设置
header(“access-control-allow-origin: http://test.com”); // 允许test.com发起的跨域请求,其他的都不通过
相关推荐:php教程
以上就是php如何设置允许跨域请求的详细内容。
其它类似信息

推荐信息