Phpcurl
In the following code I have successfully obtained the cookie and saved it in the TXT document, but cannot jump to the login page. Ask?
$ch = Curl_init ();
$data = ' email= &password= &autologin=0 ';
$cookie _file=fopen ($_server[' document_root '). " \cookies.txt "," w ");
curl_setopt ($ch, Curlopt_url, "http://www.imooc.com/user/newlogin/from_url/1003");
curl_setopt ($ch, Curlopt_returntransfer, 1);
curl_setopt ($ch, curlopt_header,0);
curl_setopt ($ch, curlopt_cookiejar,$_server[' Document_root '). " \cookies.txt ");
curl_setopt ($ch, curlopt_cookiefile,$_server[' Document_root '). " \cookies.txt ");
curl_setopt ($ch, curlopt_post,1);
curl_setopt ($ch, Curlopt_postfields, $data);
curl_setopt ($ch, curlopt_followlocation,1);
Curl_exec ($ch);
curl_setopt ($ch, Curlopt_url, "Http://www.imooc.com/space/index");
curl_setopt ($ch, curlopt_post,0);
$output =curl_exec ($ch);
Echo $output;
Curl_close ($ch);
?>