The collection shows notfound how to solve it.

Source: Internet
Author: User
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.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.