PHP Simulation Request page Jump problem

Source: Internet
Author: User
I accessed a page through a mock request a.php
Want to implement the function of Automatic request B page in a.php page

Want to ask the automatic request function code How to implement?


Reply to discussion (solution)

View the Curl function

View the Curl function

I am a novice php, can be detailed point? Thanks, man.

/** * Post method gets data * @param string $url destination URL * @param array $dataes the data to post * @param int $timeout The maximum time to wait for a response  defaults to 1 * @re Turn $output If the host is available, return the appropriate return      if it is not valid return false */static function post ($url, $dataes, $timeout =1) {$ch = Curl_init (); curl_setopt ($ch, Curlopt_url, $url) curl_setopt ($ch, curlopt_returntransfer,1);//Specify Data transfer support Postcurl_setopt ($ch, curlopt_post,1);//Set the key value of POST pass to curl_setopt ($ch, Curlopt_postfields, $dataes);//Set timeout curl_setopt ($ch, Curlopt_ TIMEOUT, $timeout), $output =curl_exec ($ch); Curl_close ($ch); return $output;}

It seems to be able to use, return information!!

  • 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.