Php simulated request page jump

Source: Internet
Author: User
Php simulated request page jump problem I access A page A. php through A simulated request
I want to implement the function of automatically requesting page B on the. php page.

Would you like to ask how to implement the automatic request function code?


Reply to discussion (solution)

View curl functions

View curl functions

I am a beginner in PHP. can I provide more details? Thank you!

/*** Obtain data in post mode * @ param string $ url destination url * @ param array $ Data to be post in dataes * @ param int $ timeout the maximum time for waiting for response is 1 by default. * @ return $ output if the host is available, the corresponding returned content is returned. if not, false */static function post ($ url, $ dataes, $ timeout = 1) {$ ch = curl_init (); curl_setopt ($ ch, CURLOPT_URL, $ url); curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 ); // specify that data transmission supports postcurl_setopt ($ ch, CURLOPT_POST, 1); // set the key value pair curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ dataes) transmitted by post ); // Set the timeout value curl_setopt ($ ch, CURLOPT_TIMEOUT, $ timeout); $ output = curl_exec ($ ch); curl_close ($ ch); return $ output ;}

It seems to be usable. a message is returned !!

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.