Some web pages must be logged in to see. At this time, if you want to capture information, you must pass the cookie value in the header to obtain it
1. First log in to the website, open firebug and you will see the corresponding cookies. Copy these cookies and you can use them
2,
- header("Content-type:text/html;Charset=utf8");
- $ch =curl_init();
- curl_setopt($ch,CURLOPT_URL,'http: //www.babytree.com/user/picjournal.php');
- $header = array();
- //curl_setopt($ch,CURLOPT_POST,true);
- //curl_setopt($ch, CURLOPT_POSTFIELDS, $fields );
- curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
- curl_setopt($ch,CURLOPT_HEADER,true); 62.7 .1401937092035530; bdshare_firstime=1401937092199; __myutma=122328856.1548793539.1401937093.1408503164.1408694138.69;');
- $content = curl_ exec($ch);
- echo "
";print_r(curl_error($ch));echo " ";
- echo "
";print_r(curl_getinfo($ch));echo " ";
- echo "
";print_r($header); echo " ";
- echo "",$content;
-
-
Copy code
|