User Tools

Site Tools


php:curl_to_facebook

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
php:curl_to_facebook [2016/07/01 23:02] peterphp:curl_to_facebook [2020/07/15 10:30] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== PHP - Curl to Facebook ====== ====== PHP - Curl to Facebook ======
  
-To login to Facebook using curl.+===== To login to Facebook using curl. =====
  
 <code php> <code php>
Line 12: Line 12:
 curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HEADER, 0);
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
-curl_setopt($ch, CURLOPT_COOKIESESSION, false); 
 curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt"); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
 curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
Line 26: Line 25:
 The cookie file 'cookies.txt' exists, and has 644 permissions.  The cookie file 'cookies.txt' exists, and has 644 permissions. 
  
 +An alternative approach is to disable cookies using:
  
 +<code php>
 +curl_setopt($ch, CURLOPT_COOKIESESSION, false);
 +</code>
  
-====== Post to a Facebook User's Wall ======+===== Post to a Facebook User's Wall =====
  
 <code php> <code php>
php/curl_to_facebook.1467410533.txt.gz · Last modified: 2020/07/15 10:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki