Show not found with file_get_contents
Show 302 found with curl
But it can be opened directly.
How to solve it?
Reply to discussion (solution)
302 Jump, paste out the code to see.
$url = ' http://www.baidu.com/link?url=0vb3_ E6Y0Y3WZNKIQD0VHEN9TAWVEPKISQZLNYFDHX-HIOROCPFQUSJ3F3HHQZLDG6YZMUXJQSWRJ7SCSSWGBF2BMQLLDPW ';
$ch = Curl_init ();
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_header, 0);
curl_setopt ($ch, curlopt_returntransfer,1);
echo $data =curl_exec ($ch);
Curl_close ($ch)
This is the URL I picked up in Baidu
Summary, do not hit Baidu idea, neutral not so much imagination
$url = ' http://www.baidu.com/link?url=0vb3_ E6Y0Y3WZNKIQD0VHEN9TAWVEPKISQZLNYFDHX-HIOROCPFQUSJ3F3HHQZLDG6YZMUXJQSWRJ7SCSSWGBF2BMQLLDPW '; $ch = Curl_init (); curl_setopt ($ch, Curlopt_url, $url); curl_setopt ($ch, Curlopt_returntransfer, 1); curl_setopt ($ch, Curlopt_header, true); curl_setopt ($ch, Curlopt_useragent, ' mozilla/5.0 (Windows; U Windows NT 5.1; En-us; rv:1.9.2) gecko/20100115 firefox/3.6 (. NET CLR 3.5.30729); curl_setopt ($ch, curlopt_followlocation,1); $html = curl_exec ($ch), Curl_close ($ch);p reg_match_all ('/^location: (? P
. *?) $/m ', $html, $matches), echo trim ($matches [' Location '][0]);//http://www.qzwb.com/jk/content/2013-05/29/content_ 4458231.htm
Show not found with file_get_contents
Show 302 found with curl
But it can be opened directly.
How to solve it?
Knot Rate: 0%, 20 points also remember knot oh.
Show not found with file_get_contents
Show 302 found with curl
But it can be opened directly.
How to solve it?
Knot Rate: 0%, 20 points also remember knot oh.
It's not like that, I'm trying to pick up the contents of http://www.qzwb.com/jk/content/2013-05/29/content_4458231.htm, I can't open it.