Functionvpost ($ url, $ data) {function for simulating data submission $ curlcurl_init (); starts a CURL session
Function vpost ($ url, $ data) {// simulate the data submission function $ curl = curl_init (); // Start a CURL session curl_setopt ($ curl, CURLOPT_URL, $ url ); // curl_setopt ($ curl, CURLOPT_SSL_VERIFYPEER, 0); // Check the certificate source curl_setopt ($ curl, CURLOPT_SSL_VERIFYHOST, 1 ); // check from the certificate whether the SSL encryption algorithm has curl_setopt ($ curl, CURLOPT_USERAGENT, $ _ SERVER ['http _ USER_AGENT ']); // simulate the user's browser curl_setopt ($ curl, CURLOPT_FOLLOWLOCATION, 1); // use automatic jump curl_setopt ($ curl, CURLOPT_AUTOREFERER, 1 ); // automatically set Referer curl_setopt ($ curl, CURLOPT_POST, 1); // send a regular Post request curl_setopt ($ curl, CURLOPT_POSTFIELDS, $ data ); // Post the submitted data packet curl_setopt ($ curl, CURLOPT_TIMEOUT, 30); // Set the timeout limit to prevent endless loops curl_setopt ($ curl, CURLOPT_HEADER, 0 ); // display the returned Header content curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, 1); // The obtained information returns $ tmpInfo = curl_exec ($ curl) as a file stream ); // execute the operation if (curl_errno ($ curl) {echo 'errno '. curl_error ($ curl); // catch an exception} curl_close ($ curl); // Close the CURL session return $ tmpInfo; // return data}