Web Hosting Talk







View Full Version : How do i read HTTPS file?


dongan
09-05-2005, 07:16 AM
Hi,

I want to read the currency rates from Worldpay and update the exchange values in the database.

I should do it in PHP. This is my code..

$myfile = file("https://select.worldpay.com/wcc/info?op=rates&instId=xxxxx");

I have also tried file_get_contents, fread.

But, i receive the following error message...

file(https://select.worldpay.com/wcc/info?op=rates&instId=xxxxx): failed to open stream: No such file or directory in /usr/local/psa/home/vhosts/xxxxx.com/httpdocs/rate.php on line 25

But, maually i am able to open the file in browsers.But, when i call the HTTPS file through a PHP file, i get this error message.

Importantly, it was working well for the past 2 months. Bu,t suddenly, from the last week, it does't work and gives the error message. I have checked with my hosting and Worldpay. No progress. Any suggestions/help would be greatly appreciated.

Regards,
Dongan

lemonadeX
09-05-2005, 09:05 AM
What you could try is calling a different HTTPS file from the Worldpay site - Its possible the problem could lie in the HTTP variables being called.

Burhan
09-05-2005, 09:31 AM
Have you considered using other methods? Such as cURL?

dongan
09-05-2005, 12:12 PM
Originally posted by lemonadeX
What you could try is calling a different HTTPS file from the Worldpay site - Its possible the problem could lie in the HTTP variables being called.

"https://select.worldpay.com/wcc/info?op=rates&instId=xxxxx" is generating the output, text file contains the exchange rates. I have tried to change the URL as "http://select.worldpay.com/wcc/info?op=rates&instId=xxxxx" to HTTP protocol. But, even in normal, if it is HTTP, they dod't return the value. They generate and return the values in HTTPS protocol only. Any suggestions...

dongan
09-05-2005, 12:16 PM
Originally posted by fyrestrtr
Have you considered using other methods? Such as cURL?

I have't tried with cURL. However could u please provide me more details on cURL?

Thanx for your help.