我试图虚拟发布表单数据以删除Facebook上的大量帖子。但是这两个代码都没有给出任何错误,也没有删除帖子。
每当我在php curl的标题数组中设置内容长度时,facebook都不会响应并且页面会继续加载。
任何人都可以指出其中的错误。
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,$fi);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_ENCODING , "gzip");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER,
array(
'authority:mbasic.facebook.com',
'method:POST',
'path:'.$actionl,
'scheme:https',
'accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'accept-encoding:gzip, deflate',
'accept-language:en-US,en;q=0.8',
'cache-control:max-age=0',
'content-length:136',
'content-type:application/x-www-form-urlencoded',
'origin:https://mbasic.facebook.com',
'referer:'.$reffr,
'upgrade-insecure-requests:1',
'user-agent:Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 Nokia5233/21.1.004; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 BrowserNG/7.2.5.2 3gpp-gba'
));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd () . '/fb.txt' ); // The cookie file'
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd () . '/fb.txt' ); // cookie jar
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec($ch);