PHP curl function simulated crawler (operation cookie)
analog cookie brush paste; The IE content to the file cookie.txt
curl_setopt ($ch, CURLOPT_COOKIEJAR, "E:/cookie.txt");
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / curl_setopt / / / / / / / / / / / / / / / / CURLOPT_COOKIEJAR. T ($ch, CURLOPT_URL, "http://www.mynit.net/login.php");
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "); / / / / / / / / / / / / / / / / / / / lose The whole content goes to the browser
curl_close ($ch);
unset ($ch);
$ch = curl_init ();
curl_setopt ($ch, 1);
/ / / execution operation, for example, brush, if you want to brush, it will be recycled 1000 times, not enough.
$buf2 = curl_exec ($ch);
curl_close ($ch);
echo $buf2; / / / / / / >.Gt; Ttp://www.nbchem.com/user/login.php? User=yourname.amp; password=pwd.amp; act=1 ');
curl_setopt ($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($c, CURLOPT_COOKIEJAR,); =curl_init ($c);
curl_setopt ($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($c, CURLOPT_COOKIEFILE, $cookie_jar);
>!