note 35903 added to ref.curl
| From: | rodrigo dot nakahodo at dhweb dot com dot br | Date: | Thu, 18 Sep 2003 16:57:00 +0000 |
| Subject: | note 35903 added to ref.curl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-56714@lists.php.net to get a copy of this message | ||
The script shows how to get a simple response of a SSL Server. Enjoy it!
<?php
$defined_vars = get_defined_vars();
$_url = 'https://www.example.com.br';
$_VAR001 = 'nono';
$_VAR002 = 'nonono';
$params = "VAR001=$_VAR001&VAR002=$_VAR002&";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$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+35903
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35903&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35903&report=yes