PHP模拟登陆
function login_post($url,$post,$cookie){
$curl=curl_init();
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_HEADER,0);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,0);
curl_setopt($curl,CURLOPT_COOKIEJAR,$cookie);
curl_setopt($curl,CURLOPT_POST,1);
curl_setopt($curl,CURLOPT_POSTFIELDS,http_build_query($post));
curl_exec($curl);
curl_close($curl);
}
function get_content($url,$cookie){
$curl=curl_init();
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_HEADER,0);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,0);
curl_setopt($curl,CURLOPT_COOKIEFILE,$cookie);
curl_exec($curl);
curl_close($curl);
}