Currency Converter: "URL file-access is disabled"
Posted by: decentone
Posted on: 2007-01-24 23:06:00
Hello,
I have a currency converter running in a Flash based store that's not currently working. I'm not sure how to go about solving this problem but when I run the PHP file directly, here are the error messages that I'm receiving:
Warning: file() [function.file]: URL file-access is disabled in the server configuration in currency.php on line 13
Warning: file(http:///m5?a=1.00&t=&s=) [function.file]: failed to open stream: no suitable wrapper could be found in currency.php on line 13
Warning: join() [function.join]: Bad arguments. in currency.php on line 14
&success=&toAmount=&
The code from the PHP file is as follows...
In reply to:<?php
// $from var defined in cart_init
$from = $HTTP_POST_VARS['fromCurrency'];
// $to var defined in main.as
$to = $HTTP_POST_VARS['toCurrency'];
// amount var defined in main.as
$amount="1.00";
$query_url = $HTTP_POST_VARS['query_url'];
$money[0]=file('http://'.$query_url.'/m5?a='.$amount.'&t='.$to.'&s='.$from.'');
$money[0] = join("",$money[0]);
$money[0] = ereg_replace(".*<table border=1 cellpadding=2 cellspacing=0>",'',$money[0]);
$money[0] = ereg_replace("</table>.*",'',$money[0]);
// get exchange rate
$money[0] = ereg_replace("</td>.*",'',$money[0]);
$money[0] = ereg_replace(".*<td>",'',$money[0]);
// get value conversion
$rString=('&success='.$to.'&toAmount='.$money[0]);
echo $rString."&";
?>
Thanks in advance to anyone who might be able to help out here... it would be greatly greatly appreciated.