program ideas and related code

Source: Internet
Author: User
Ask for a program idea and related code
I would like to make a website feature such as http://www.ccua.com.cn/
Ask this webmaster, but he won't reveal a bit
I have no idea, can I have a master enlighten one or two?

------Solution--------------------
Capture content with Curl

It was originally collected through file_get_contents ($url). Helpless, out of a coding failure is always impossible to solve. Finally choose Curl Implementation. With curl you need to copy the Libeay32.dll and ssleay32.dll two files under PHP to System32, and then the extension = Php_curl.dll in php.ini is turned on.

A code example is shown below.

PHP Code
function Generatehtmlbycurl ($url, $filename)    {    $ch = Curl_init ();    $timeout = 1000; Set to 0 for no timeout    curl_setopt ($ch, Curlopt_url, $url);    curl_setopt ($ch, Curlopt_returntransfer, 1);    curl_setopt ($ch, Curlopt_timeout, $timeout);    $handles = curl_exec ($ch);    Curl_close ($ch);     File_put_contents ($filename, $handles);   }
  • 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.