function vpost ($url, $data) {//analog commit data functions
$curl = Curl_init ();//Start a Curl session
curl_setopt ($curl, Curlopt_url, $url);//address to be accessed
curl_setopt ($curl, Curlopt_ssl_verifypeer, 0);//Check the origin of the certification certificate
curl_setopt ($curl, Curlopt_ssl_verifyhost, 1);//Check whether the SSL encryption algorithm exists from the certificate
curl_setopt ($curl, curlopt_useragent, $_server[' http_user_agent ');//browser used by the impersonated user
curl_setopt ($curl, curlopt_followlocation, 1);//Use auto-jump
curl_setopt ($curl, Curlopt_autoreferer, 1);//Auto Set Referer
curl_setopt ($curl, Curlopt_post, 1);//Send a regular POST request
curl_setopt ($curl, Curlopt_postfields, $data);//post-submitted packets
curl_setopt ($curl, Curlopt_timeout, 30);//Set timeout limit to prevent dead loops
curl_setopt ($curl, Curlopt_header, 0);//Displays the contents of the HEADER area returned
curl_setopt ($curl, Curlopt_returntransfer, 1);//Gets the information returned as a file stream
$tmpInfo = curl_exec ($curl);//Perform Operation
if (Curl_errno ($curl)) {
echo ' Errno '. Curl_error ($curl);//Catch Exception
}
curl_close ($curl);//Close Curl Session
return $tmpInfo;//returns Data
}
$url = "https://xxx.xxx.xxx/xxx";
$data = "x=xxxxxx";
$result = vpost ($url, $data);
PHP CURL HTTPS POST