dongwei1954 2016-09-04 08:17
浏览 58

Facebook php curl在设置内容长度时没有返回响应

I am trying to virtually post form data to delete lots of posts on facebook. But neither code is giving any error nor the post is being deleted.

Whenever I set content length in header array of php curl, facebook does not respond and page keeps loading.

Can anyone point out whats the mistake in it.

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);
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示
    • ¥15 求三国群英传pl国战时间的修改方法
    • ¥15 matlab代码代写,需写出详细代码,代价私