A站(www.a.com),有个form表单,ajax提交到 B站(www.b.com),还附带个验证码。
A站上的表单代码如下:1、提交到 http://www.b.com/plus/diy.php
2、验证码 http://www.b.com/include/vdimgck.php
3、ajax 跨域必需js代码
xhrFields:{withCredentials: true},
crossDomain:true,
B站上的 /plus/diy.php 文件上面加入
header("Access-Control-Allow-Credentials:true");
header("Access-Control-Allow-Origin:http://www.a.com");
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)