Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2001051

[PHP-DB] file() fails to read https From: Mark Cain (markcain <email protected>)
Date: 05/14/01

I am writing php code on a Unix server which reads a call to Micro$oft SQL statement via asp on an IIS server. I am using file() to get the results.

This works beautifully:

$fcontents = file ("http://www.domain.com/URLSearch.asp?Info=$info");

The results of the query are in $fcontents. Pretty standard php stuff.

However, when I make the same call on a secure connection (as in) ,
$fcontents = file ("https://www.domain.com/URLSearch.asp?Info=$info");

I get the following error message:

Warning: file("https://www.domain.com/URLSearch.asp?Info=$info") - No such file or directory in /home/mysite/phplib/getinfo.php on line 4

The only change in the entire code is the "s".

Let me see if I can answer some questions before they are asked:

Yes. I am actually getting real content on the non-secure connection.
Yes. The secure connection is really functional on the other server. (I can actually cut the above address and paste it into the address bar and get the results that I am expecting.)

So, my question is "How do I read this secure file?" No one even mentions https in the file() function section of php.net.

Thanks,

Mark