Hi there
I wrote (hacked) a script to obtain exchange rates from yahoo.com and dump them in a file to be used later:
<HEAD>
<TITLE>Exchange Rates</TITLE>
</HEAD>
<BODY>
<?
$ratesfile="rates.inc";
$type = array("GBP", "EUR", "USD", "AUD", "HKD", "JPY", "SGD", "THB");
$money[0]=file('http://quote.yahoo.com/m5?a=1&t=GBP&s=GBP');
$money[1]=file('http://quote.yahoo.com/m5?a=1&t=EUR&s=GBP');
$money[2]=file('http://quote.yahoo.com/m5?a=1&t=USD&s=GBP');
$money[3]=file('http://quote.yahoo.com/m5?a=1&t=AUD&s=GBP');
$money[4]=file('http://quote.yahoo.com/m5?a=1&t=HKD&s=GBP');
$money[5]=file('http://quote.yahoo.com/m5?a=1&t=JPY&s=GBP');
$money[6]=file('http://quote.yahoo.com/m5?a=1&t=SGD&s=GBP');
$money[7]=file('http://quote.yahoo.com/m5?a=1&t=THB&s=GBP');
$fp=fopen($ratesfile,"w");
fputs($fp,"<%\n");
for($i=0; $i<sizeof($money); $i++){
$money[$i] = join("",$money[$i]);
$money[$i] = ereg_replace(".<table border=1 cellpadding=2 cellspacing=0>",'',$money[$i]);
$money[$i] = ereg_replace("</table>.",'',$money[$i]);
$money[$i] = ereg_replace("</b>.",'',$money[$i]);
$money[$i] = ereg_replace(".<b>",'',$money[$i]);
fputs($fp, "\$$type[$i]=\"$money[$i]\";\n");
}
fputs($fp,"%>\n");
fclose($fp);
echo "Currencies Updated.\n";
?>
</BODY>
You need to create the file rates.inc in the same directory which should be writable (777) and ensure your server recognises <% %> style tags.
Good luck!!
Paul