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

curl-and-php

RE: Download a file from an https site.

From: Fluteau Jerome ICM N PG U PLM A 2 <jerome.fluteau_at_siemens.com>
Date: Thu, 31 Oct 2002 09:20:29 +0100

I finally solve this silly problem using this code:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://my-server.com/");
ob_start();
curl_exec($ch);
$str = ob_get_contents();
ob_end_clean();
curl_close($ch);

$fp = fopen('test.txt', "w");
fwrite($fp, $str);
fclose ($fp);

Thanks a lot to Edmund Horner which gave me this code.

-----Original Message-----
From: Dave Withnall [mailto:withnall_at_connexus.net.au]
Sent: Wednesday, October 30, 2002 11:01 PM
To: curl-and-php_at_lists.sourceforge.net
Subject: RE: Download a file from an https site.

At 02:48 PM 30/10/2002 +0100, Fluteau Jerome ICM N PG U PLM A 2 wrote:
>Hi,
>
>I still don't know why I have this problem, I read that it could be a RAM
>problem or maybe Apache is using the
>dll from a previous install...
>Anyway I'm gonna try with the curl command line tool. After installing it,
I
>tried this command in MSDOS:
>
>curl https://my-server.com
>
>and it worked, I got the HTML code of this page.
>Now how can I do the same thing within PHP? Using this:
>
>exec("curl "https://my-server.com"");
>
>but then how can I get the HTML code as in the command line?

Check out the cURL section in the php manual. everything you need is in
there.
Or if you want to use exec() then the standard cURL commands apply and
they're on the curl.haxx.se website.
D.

-------------------------------------------------------
This sf.net email is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en

-------------------------------------------------------
This sf.net email is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
Received on 2002-10-31