note 98164 deleted from function.curl-setopt by cmb

From: Date: Sun, 24 Nov 2019 08:35:28 +0000
Subject: note 98164 deleted from function.curl-setopt by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-213186@lists.php.net to get a copy of this message
Note Submitter: shailesh4all at gmail dot com ---- Hi, Anyone who is interested in submitting their information by post to HTTPS site (e.g. payment gateway) where https page needs basic authentication before submitting the information. below code will be helpful. <?php $submit_url = "https://sitename/process.php"; $curl = curl_init(); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ; curl_setopt($curl, CURLOPT_USERPWD, "username:password"); curl_setopt($curl, CURLOPT_SSLVERSION,3); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $params ); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($curl, CURLOPT_URL, $submit_url); $data = split("text/html", curl_exec($curl) ); $temp = split("\r\n", $data[1]) ; $result = unserialize( $temp[2] ) ; print_r($result); curl_close($curl); ?>

« previous php.notes (#213186) next »