Welcome to WebmasterWorld Guest from 54.146.171.44

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

How to get SSL pages in PHP

Can it be done?

   
9:35 pm on Apr 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP has some neat support for retrieving html over the 'net. Just open it like a regular file. This doesn't work for SSL pages (https://) until version 4.3 (which isn't yet released). Is there any hack to get around this and have it retrieve the html of a https:// page. Perhaps going through lynx? This would be a very legitimate (university) use. Stickymail me if you want to know the specifics.
12:39 am on May 1, 2002 (gmt 0)

10+ Year Member



lynx? Maybe. But I find cURL [curl.haxx.se] quite easy to use. For example,


<?php

$url = 'https://some.secure.site/';
exec("/usr/bin/curl $url", $lines);

$lines = implode($lines, "\n");
$lines = htmlspecialchars($lines);

echo "<pre>$lines</pre>";

?>

2:41 am on May 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah, nice. Thanks a ton.