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 !!