Php 服务器更改后,cURL POST请求失败

Php 服务器更改后,cURL POST请求失败,php,curl,header,Php,Curl,Header,所以我有一个脚本来管理游戏选项,几周前它运行得很好。然而,游戏服务器改变了,我的脚本不能再通过cURL处理POST请求了 这很好: $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, "http://secura.e-sim.org/donateProducts.html?id=".$player); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLO

所以我有一个脚本来管理游戏选项,几周前它运行得很好。然而,游戏服务器改变了,我的脚本不能再通过cURL处理POST请求了

这很好:

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://secura.e-sim.org/donateProducts.html?id=".$player);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_ENCODING, "");
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_FAILONERROR, true);
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($curl, CURLOPT_COOKIEJAR, $_SERVER["DOCUMENT_ROOT"].'/vdod/cookies/'.$_SESSION["operator"].'.txt');
curl_setopt($curl, CURLOPT_COOKIEFILE, $_SERVER["DOCUMENT_ROOT"].'/vdod/cookies/'.$_SESSION["operator"].'.txt');
curl_exec($curl);
我得到了期望的输出。但是,紧跟其后的代码是:

curl_setopt($curl, CURLOPT_URL, "http://secura.e-sim.org/donateProducts.html?id=".$player);
curl_setopt($curl, CURLOPT_POSTFIELDS, "product=".$fetchSupplies["gift_quality"]."-GIFT&quantity=".$fetchSupplies["gift_amount"]);
curl_exec($curl);
给我这个结果:

HTTP/1.1 302 Found Date: Fri, 14 Mar 2014 12:19:41 GMT Server: Apache/2.4.6 (Ubuntu) Location: http://secura.e-sim.org?citizenMessage=UNKNOWN_ERROR Content-Language: en-US Content-Length: 0 Connection: close Content-Type: text/html HTTP/1.1 200 OK Date: Fri, 14 Mar 2014 12:19:41 GMT Server: Apache/2.4.6 (Ubuntu) Content-Language: en-US Vary: Accept-Encoding Content-Encoding: gzip Content-Length: 22927 Connection: close Content-Type: text/html;charset=UTF-8
POST请求失败。游戏返回关于uknown错误的消息,我注意到标题显示内容长度是。。。0

所有变量都是正确的,我调试过了

我只是不知道该怎么处理。如何使POST请求再次可用

问题是,只有这个模块被POST请求搞砸了。我仍然可以在游戏中发送自动消息(它也使用curlpost)。为什么这个特殊的返回内容长度:0

PS2:是的,我试着包括

curl_setopt($curl, CURLOPT_POST, 1);
什么也没发生


有人帮忙吗?

试着调试var_dump(curl_getinfo($channel));这可能与它是子域有关吗?但是其他curlpost请求也会失败。他们没有。就是这个模块,这个代码失败了。下面的代码在其他模块中运行良好<代码>curl\u setopt($curl,CURLOPT\u URL,“http://secura.e-sim.org/composeMessage.html");
curl\u setopt($curl,CURLOPT\u POSTFIELDS,“action=REPLY&receiverName=“.$data[“login”]”和title=“.$message\u title.”和body=“.$message”)这是您发布的某种公共API吗?如果是,请询问提供商该错误的原因…