note 35879 added to ref.curl

From: Date: Wed, 17 Sep 2003 22:06:48 +0000
Subject: note 35879 added to ref.curl
Groups: php.notes 
Request: Send a blank email to php-notes+get-56663@lists.php.net to get a copy of this message
The script shows how to get a simple HTTPS response from SSL server(using CURL session). Enjoy it! <?php $defined_vars = get_defined_vars(); $_url = 'https://www.example.com.br'; $_VAR1 = 'nonono'; $_VAR2 = 'nonono'; $_VAR3 = 'nononono'; $post_params = "VAR1=$_VAR1&VAR2=$_VAR2&VAR3=$_VAR3&"; $ch = curl_init(); curl_setopt($ch, CURLOPT_POST,1); curl_setopt($ch, CURLOPT_POSTFIELDS,$post_params); curl_setopt($ch, CURLOPT_URL,$_url); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_USERAGENT, $defined_vars['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $result = curl_exec ($ch); curl_close ($ch); echo("Output: ".$result); ?> ---- Manual Page -- http://www.php.net/manual/en/ref.curl.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35879 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35879&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35879&report=yes

« previous php.notes (#56663) next »