开发者

how to access third party website

//$out = fopen($localfilename, 'wb'); 
$url ="some https site name";
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
//curl_setopt($ch, CURLOPT_FILE, $out); 
curl_setopt($ch, CURLOPT_HEADER, 0); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_USERPWD, "sar:pas"); 
echo curl_exec($ch); 
return $ch;
//curl_close($ch); 
//fclose($out); 

i tried with code for automatic login to thirdparty website

$url="some url name";

in the username password i used curl_setopt($ch, CURLOPT_USERPWD, "sar:pas"); i alread fetech the username password from database table but i am not using file & i commented the belowed two lines in the code

$out = fopen($localfilename, 开发者_如何学Go'wb');
curl_setopt($ch, CURLOPT_FILE, $out);

i have tried the code its not working in https site help me in this senorio

by saravanamuthu


To access HTTPS websites, you would need to set the following cURL option:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

HTH.


EDIT: Here's a helpful site: http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/ that you get by googling "curl https"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜