惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
PCI Perspectives
PCI Perspectives
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
量子位
博客园_首页
S
SegmentFault 最新的问题
S
Secure Thoughts
F
Full Disclosure
H
Hacker News: Front Page
博客园 - 三生石上(FineUI控件)
U
Unit 42
H
Heimdal Security Blog
N
News and Events Feed by Topic
A
About on SuperTechFans
C
CERT Recently Published Vulnerability Notes
Cyberwarzone
Cyberwarzone
Help Net Security
Help Net Security
The Hacker News
The Hacker News
L
LINUX DO - 最新话题
Application and Cybersecurity Blog
Application and Cybersecurity Blog
罗磊的独立博客
N
News | PayPal Newsroom
Spread Privacy
Spread Privacy
C
Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
云风的 BLOG
云风的 BLOG
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Simon Willison's Weblog
Simon Willison's Weblog
B
Blog
人人都是产品经理
人人都是产品经理
TaoSecurity Blog
TaoSecurity Blog
博客园 - 【当耐特】
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
I
InfoQ
D
DataBreaches.Net
大猫的无限游戏
大猫的无限游戏
Apple Machine Learning Research
Apple Machine Learning Research
L
LINUX DO - 热门话题
Google Online Security Blog
Google Online Security Blog
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
Know Your Adversary
Know Your Adversary
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog RSS Feed

博客园 - 早上六点半遇见五月天

PHP 关于用判断is_resource函数判断 CURL 句柄,在 PHP 7.2+ 版本有一个重要变化! mysql 存储不过1000个中文选什么数据类型 PHP curl 模拟GET请求接口报错HTTP Status 400 – Bad Request 问题 删除所有的php-fpm进程命令 利用Navicat premium实现将数据从Oracle导入到MySQL Mac版phpstorm 一次性折叠所有函数/方法的快捷键 Mac 多次killall php-fpm之后会php-fpm会自动启动 解决方法 PHP 常用的字符串函数 MySQL 表示日期的数据类型 同一局域网下Mac无法远程连接至win7报错:Unable to connect to remote PC. MySQL 支持的存储引擎 设计模式之单例模式 MySQL 数据定义语言(DDL) 设计模式的原则和法则 GoF的23种设计模式分类和功能 Mac brew安装的php修改了php.ini之后如何重启php? PHP 文件上传之如何识别文件伪装?——PHP的fileinfo扩展可! PHP 超全局变量之$_FILES PHP 超全局变量之$GLOBALS
PHP 跨域之header
早上六点半遇见五月天 · 2020-01-03 · via 博客园 - 早上六点半遇见五月天

之前的博客里记录了PHP解决跨域的方案:JSONP;https://www.cnblogs.com/pawn-i/p/11899120.html

除了jsonp之后,还是通过header函数设置响应头解决跨域问题:

设置允许访问的域名:

  1. 允许全部的域名访问
    header("Access-Control-Allow-Origin:*");
  2. 允许指定域名访问
    header( 'Access-Control-Allow-Origin:http://a.test.com' );  

设置允许访问的请求方式:

  1.  一种或者多种
    header('Access-Control-Allow-Methods:POST,GET,OPTIONS,DELETE'); 
  2. 全部
    header('Access-Control-Allow-Methods:*');  

然后根据需要再设置其他的参数……