A beginner's question

Source: Internet
Author: User
A Cainiao asked a question recently. it was difficult to hear from the php course. The following is the problem Code & lt ;? Php & nbsp; $ url = & quot; http://php.weather.sina.com.cn/search.php? City = 021 & amp; dpc = 1 & quot; // target site $ fp = @ fopen ($ ur a Cainiao's question
It's hard to listen to php courses recently
The following is the code for the problem
$ Url = "http://php.weather.sina.com.cn/search.php? City = 021 & dpc = 1 "; // target site
$ Fp = @ fopen ($ url, "r") or die ("timeout ");
$ Fcontents = file_get_contents ($ url );
Echo $ fcontents;
?>
The purpose is to use the weather forecasts of other websites, but I don't know why the connection cannot be opened. it is useful when people connect websites.


Unable to display webpage
The page you are searching for is currently unavailable. The website may encounter support problems, or you need to adjust your browser settings.

Please help me check it out. thank you ~

------ Solution --------------------
I am working normally. I can open it and crawl the webpage code normally. I don't know what the LZ encounters. can I send a picture?
------ Solution --------------------
Discussion

Reference:
I am working normally. I can open it and crawl the webpage code normally. I don't know what the LZ encounters. can I send a picture?


Are you running php?

------ Solution --------------------
Discussion

Reference:
Reference:

Reference:
I am working normally. I can open it and crawl the webpage code normally. I don't know what the LZ encounters. can I send a picture?


Are you running php?


Yes, aren't you?


So I don't know what went wrong?

------ Solution --------------------
It looks like a problem with your website. check php. ini for any error prompt: display_error = On

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.