Which of the following experts can use curl or file_get_contents to obtain the content of this webpage?

Source: Internet
Author: User
Who can use curl or file_get_contents to retrieve the content of this webpage? Zhaohongen.fu.cn8u.cnv.html. if you can, please do not tell me the method. thank you !! ------ Solution ------------------ This is a jump after a click, rather than writing a header jump by yourself. after reading the code, it is actually a visit using curl. Who can use curl or file_get_contents to retrieve the content of this webpage?
Http://zhaohongen.fu.cn8u.cn/v.html
If you can, please do not tell me. thank you !!

------ Solution --------------------
This is a jump after a click, not a header jump.
After reading the code, you can hide your ears and ears.

Use curl for access. You only need to access this page for the first time to save the cookie and then refresh the page with the cookie.
The cookie is used completely for control, so I will not try it.

You can open the http://zhaohongen.fu.cn8u.cn/v.html in the browser, open a tab, and then access the http://zhaohongen.fu.cn8u.cn/v.html

The content is displayed, and the cookie is cleared, and the above steps have to be repeated. Therefore, you only need to control the cookie.

------ Solution --------------------
It's really hard to figure out. Niu said, cookie problems.
PHP code
$cookie_file = dirname(__FILE__).'/cookie.txt';if(!file_exists($cookie_file)){    $fp= fopen($cookie_file,"w");    fclose($fp);}$url = "http://zhaohongen.fu.cn8u.cn/v.html";$ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIEJAR,  $cookie_file); curl_exec($ch);curl_close($ch);$url = "http://zhaohongen.fu.cn8u.cn/v.html";$ch = curl_init($url);curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); $response = curl_exec($ch);curl_close($ch);echo $response; 

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.