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

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
Help Net Security
Help Net Security
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
LINUX DO - 热门话题
Security Latest
Security Latest
A
Arctic Wolf
G
GRAHAM CLULEY
月光博客
月光博客
S
Securelist
D
Docker
J
Java Code Geeks
T
Troy Hunt's Blog
T
Tenable Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 最新话题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
aimingoo的专栏
aimingoo的专栏
博客园 - 【当耐特】
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Forbes - Security
Forbes - Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
B
Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
S
Secure Thoughts
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Check Point Blog
云风的 BLOG
云风的 BLOG
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Blog of Author Tim Ferriss
L
Lohrmann on Cybersecurity
F
Full Disclosure
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News 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:*');  

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