Re: file and https

From: Date: Fri, 21 Feb 2003 15:03:05 +0000
Subject: Re: file and https
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-25827@lists.php.net to get a copy of this message
on 2/21/03 9:52 AM, Ryan Jameson (USA) at RJameson@usa.ibs.org appended the following bits to my mbox: > Has anyone found a way to import data through ssl into a php script? If I can > pull xml formatted data through a secure socket it will save some major > headaches with a problem I need to solve. > > $url = file("https://www.mydomain.com"); Would be > ideal, but it does not > work.... Not really related to databases so it should be on PHP-General. That said... To work with HTTPS, you typically need to use the CURL library functions: <http://www.php.net/manual/en/ref.curl.php> I think in your case, specifically use: <http://www.php.net/manual/en/function.curl-exec.php> If I recall correctly, PHP 4.3 began bundling https support into its fopen wrappers so if you upgrade, you can use https directly in fopen calls (not sure if it works with "file") If you don't want to recompile with CURL support, nor want to upgrade to PHP 4.3.x, you may be able to call a command line utility directly. For example, I've used this in the past: passthru('curl https://secure.example.com/some-file.html'); Hope that helps. Sincerely, Paul Burney <http://paulburney.com/> <?php while ($self != "asleep") { $sheep_count++; } ?>

« previous php.db (#25827) next »