php 模拟登陆
php 模拟登陆$url = "http://www.discuz.net/";
<?php $useragent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; TheWorld)"; $cookie = "dznet_cookietime=2592000;dznet_onlineusernum=7816;dznet_sid=QtlC87;dznet_auth=6bbeCQrzGv4eliNMLgU%2FlGZSpzbrsauGO1l0OBp6VQw5p0bcEg0xd4slYCM2ks%2FL0YCVYSO7XP2z8GMaxkPDUbXZCWft;checkpm=1"; $ch= curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_COOKIE, $cookie); curl_setopt($ch, CURLOPT_REFERER, "http://www.discuz.net/index.php"); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_USERAGENT, $useragent); curl_exec($ch); $tempCn = curl_multi_getcontent($ch); curl_close($ch); echo $tempCn;
文章网址:http://www.phprm.com/code/278506c586c367930c7a37ed7201ec81.html
随意转载^^但请附上教程地址。