cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

curl (with php to HTTPS)

From: Lim Chung Keng <keng_at_web.cc>
Date: Wed, 11 Apr 2001 12:31:54 +0800

Hi..

I have configured my curl binary (command line) to work with HTTPS successfully.
    curl https://mysecure.server/.... does return something.

However, it does not seem to work when I used curl library functions (e.g. curl_init) to call HTTPS. Isn't it supposed to look like what the curl binary returns??

Here is the code:

<?
   $url = https://mysecure.server/...;
   $domain = "testxxx";
   $passwd = "xxxyyy";

   $req = "domain=".urlencode($domain).
          "&password=".urlencode($passwd).
   
   $ch = curl_init();
   curl_setopt ($ch, CURLOPT_URL, $url);
   curl_setopt ($ch, CURLOPT_POSTFIELDS, $req);
   curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
   curl_setopt ($ch, CURLOPT_POST, 1);
   curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
   curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
   
   $results = curl_exec ($ch);
   curl_close ($ch);
   print "($results)\n";

?>

Result is : () <-- Nothing...

What did I do wrong?

Thank you very much,
Keng keng_at_web.cc

_______________________________________________
Curl-and-php mailing list
Curl-and-php_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-and-php
Received on 2001-04-11