- 相關(guān)推薦
phpcurl模擬登錄網(wǎng)站
$cookie_file = tempnam('./temp','cookie');
$login_url=
$post_file=
$ch=curl_init($login_url); /////初始化一個(gè)CURL對(duì)象
curl_setopt($ch,CURLOPT_HEADER,0);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); ///設(shè)置不輸出在瀏覽器上 curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$post_file); ////傳遞一個(gè)作為HTTP
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file); /////把返回來的cookie信息保存在$cookie_jar文件中
curl_exec($ch);///執(zhí)行
curl_close($ch);////關(guān)閉
$url=
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_COOKIEFILphpcurl模擬登錄網(wǎng)站E, $cookie_file);
$contents = curl_exec($ch);
print_r($contents);
?>
【phpcurl模擬登錄網(wǎng)站】相關(guān)文章:
要更富先登錄04-30
交互式登錄介紹08-09
內(nèi)蒙古法宣在線登錄入口09-19
登錄普將在華建航空輪胎翻胎廠04-27
不必登錄Web頁QQ空間管理本地化04-26
網(wǎng)站策劃08-02
【經(jīng)典】網(wǎng)站策劃01-20
好的網(wǎng)站05-02