PHP cURL to login to facebook

前端 未结 4 960
日久生厌
日久生厌 2020-12-28 19:59

I am attempting to login to Facebook using curl, but everything I have tried has ended up in Facebook saying, \"Cookies are not enabled on your browser. Please enable cookie

相关标签:
4条回答
  • 2020-12-28 20:20

    This may help:

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    

    Check this answer:

    Post to a Facebook user's wall with cURL PHP

    0 讨论(0)
  • 2020-12-28 20:23

    I had the same problem and I fixed it by adding the following:

    curl_setopt($s, CURLOPT_COOKIESESSION, false);

    0 讨论(0)
  • 2020-12-28 20:29

    This must be used on curl cookie :

    curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd () . '/mirazmac_cookie.txt' );
    
    curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd () . '/mirazmac_cookie.txt' );
    
    0 讨论(0)
  • 2020-12-28 20:47

    Better to use use facebook login sdk

    Because Facebook constantly makes changes to their source code.

    0 讨论(0)
提交回复
热议问题