PHP Simulation Request page Jump related issues

Source: Internet
Author: User
PHP Simulation Request page Jump problem
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?
------Solution--------------------

/**
* Post method to get 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
* @return $output Returns the appropriate return if the host is available if it is not valid returns 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 post
curl_setopt ($ch, curlopt_post,1);
Set the key-value pair for post delivery
curl_setopt ($ch, Curlopt_postfields, $dataes);
Set timeout
curl_setopt ($ch, Curlopt_timeout, $timeout);
$output =curl_exec ($ch);
Curl_close ($ch);
return $output;
}
  • 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.