php facebook login + curl + proxy -


i using curl script login in facebook

function curl($url, $header=null, $cookie=null, $p=null) {      $ch = curl_init();     curl_setopt($ch, curlopt_header, $header);     curl_setopt($ch, curlopt_nobody, $header);     curl_setopt($ch, curlopt_httpproxytunnel, 1);     curl_setopt($ch, curlopt_url, $url);     curl_setopt($ch, curlopt_ssl_verifyhost, 0);     curl_setopt($ch, curlopt_cookie, $cookie);     curl_setopt($ch, curlopt_useragent, $_server['http_user_agent']);     curl_setopt($ch, curlopt_returntransfer, 1);     curl_setopt($ch, curlopt_ssl_verifypeer, 0);     curl_setopt($ch, curlopt_followlocation, 1);      if ($p) {         curl_setopt($ch, curlopt_customrequest, "post");         curl_setopt($ch, curlopt_post, 1);         curl_setopt($ch, curlopt_postfields, $p);     }     $result = curl_exec($ch);      if ($result) {          return $result;      } else {              return curl_error($ch);     }     curl_close($ch); }  // use of function   $cookie="";  $a = curl("https://login.facebook.com/login.php?login_attempt=1",true,null,"email=$email&pass=$password");  preg_match('%set-cookie: ([^;]+);%',$a,$b);  $c = curl("https://login.facebook.com/login.php?login_attempt=1",true,$b[1],"email=$email&pass=$password");  preg_match_all('%set-cookie: ([^;]+);%',$c,$d);  for($i=0;$i<count($d[0]);$i++) {     $cookie .= $d[1][$i].";  }  $usercontent=curl("http://www.facebook.com/ads/adboard/",null,$cookie,null); 

i want proxy curl please let me know how it?

i guess curlopt_proxy want?

curl_setopt( $ch, curlopt_proxy, ... ) 

http://php.net/curl_setopt


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -