<html>
<head>
<title>Currency Convert</title>
</head>
<body>
<?php
$currency = Array(
'DZD' => 'Algerian Dinar',
'ARS' => 'Argentine Peso',
'AUD' => 'Australian Dollar',
'BSD' => 'Bahamian Dollar',
'BHD' => 'Bahraini Dinar',
'BDT' => 'Bangladesh Taka',
'BYR' => 'Belarus Ruble ',
'BZD' => 'Belize Dollar',
'BMD' => 'Bermuda Dollar',
'BTN' => 'Bhutan Ngultrum ',
'BOB' => 'Bolivian Boliviano',
'BRL' => 'Brazilian Real',
'GBP' => 'British Pound ',
'BND' => 'Brunei Dollar',
'BIF' => 'Burundi Franc',
'XOF' => 'CFA Franc',
'XAF' => 'CFA Franc',
'KHR' => 'Cambodia Riel',
'CAD' => 'Canadian Dollar',
'KYD' => 'Cayman Islands Dollar',
'CLP' => 'Chilean Peso',
'CNY' => 'Chinese Yuan',
'COP' => 'Colombian Peso',
'KMF' => 'Comoros Franc',
'CRC' => 'Costa Rica Colon',
'HRK' => 'Croatian Kuna',
'CUP' => 'Cuban Peso',
'CYP' => 'Cyprus Pound',
'CZK' => 'Czech Koruna',
'DKK' => 'Danish Krone',
'DJF' => 'Dijibouti Franc',
'DOP' => 'Dominican Peso',
'XCD' => 'East Caribbean Dollar',
'ECS' => 'Ecuador Sucre',
'EGP' => 'Egyptian Pound',
'SVC' => 'El Salvador Colon',
'ERN' => 'Eritrea Nakfa',
'EEK' => 'Estonian Kroon',
'ETB' => 'Ethiopian Birr',
'EUR' => 'Euro',
'FKP' => 'Falkland Islands Pound',
'GMD' => 'Gambian Dalasi',
'GHC' => 'Ghanian Cedi',
'GIP' => 'Gibraltar Pound',
'XAU' => 'Gold Ounces',
'GTQ' => 'Guatemala Quetzal',
'GNF' => 'Guinea Franc',
'HTG' => 'Haiti Gourde',
'HNL' => 'Honduras Lempira',
'HKD' => 'Hong Kong Dollar',
'HUF' => 'Hungarian Forint',
'ISK' => 'Iceland Krona',
'INR' => 'Indian Rupee',
'IDR' => 'Indonesian Rupiah',
'IRR' => 'Iran Rial',
'ILS' => 'Israeli Shekel',
'JMD' => 'Jamaican Dollar',
'JPY' => 'Japanese Yen',
'JOD' => 'Jordanian Dinar',
'KZT' => 'Kazakhstan Tenge',
'KES' => 'Kenyan Shilling ',
'KRW' => 'Korean Won ',
'KWD' => 'Kuwaiti Dinar',
'LAK' => 'Lao Kip ',
'LVL' => 'Latvian Lat',
'BP' => 'Lebanese Pound',
'LSL' => 'Lesotho Loti',
'LYD' => 'Libyan Dinar',
'LTL' => 'Lithuanian Lita',
'MOP' => 'Macau Pataca',
'MKD' => 'Macedonian Denar',
'MGF' => 'Malagasy Franc',
'MWK' => 'Malawi Kwacha',
'MYR' => 'Malaysian Ringgit',
'MVR' => 'Maldives Rufiyaa',
'MTL' => 'Maltese Lira',
'MRO' => 'Mauritania Ougulya',
'MUR' => 'Mauritius Rupee',
'MXN' => 'Mexican Peso',
'MDL' => 'Moldovan Leu',
'MNT' => 'Mongolian Tugrik ',
'MAD' => 'Moroccan Dirham ',
'MZM' => 'Mozambique Metical',
'NAD' => 'Namibian Dollar ',
'NPR' => 'Nepalese Rupee ',
'ANG' => 'Neth Antilles Guilder',
'NZD' => 'New Zealand Dollar ',
'NIO' => 'Nicaragua Cordoba ',
'NGN' => 'Nigerian Naira ',
'NOK' => 'Norwegian Krone ',
'OMR' => 'Omani Rial ',
'XPF' => 'Pacific Franc',
'PKR' => 'Pakistani Rupee ',
'XPD' => 'Palladium Ounces',
'PAB' => 'Panama Balboa',
'PGK' => 'Papua New Guinea Kina',
'PYG' => 'Paraguayan Guarani ',
'PEN' => 'Peruvian Nuevo ',
'PHP' => 'Philippine Peso',
'XPT' => 'Platinum Ounces',
'PLN' => 'Polish Zloty',
'QAR' => 'Qatar Rial',
'ROL' => 'Romanian Leu',
'RUB' => 'Russian Rouble',
'RWF' => 'Rwanda Franc ',
'WST' => 'Samoa Tala ',
'STD' => 'Sao Tome Dobra ',
'SAR' => 'Saudi Arabian Riyal',
'SCR' => 'Seychelles Rupee ',
'SLL' => 'Sierra Leone Leone ',
'XAG' => 'Silver Ounces',
'SGD' => 'Singapore Dollar',
'SKK' => 'Slovak Koruna',
'SIT' => 'Slovenian Tolar',
'SOS' => 'Somali Shilling',
'ZAR' => 'South African Rand',
'LKR' => 'Sri Lanka Rupee',
'SHP' => 'St Helena Pound',
'SDD' => 'Sudanese Dinar',
'SRG' => 'Surinam Guilder',
'SZL' => 'Swaziland Lilageni',
'SEK' => 'Swedish Krona',
'CHF' => 'Swiss Franc',
'SYP' => 'Syrian Pound',
'TWD' => 'Taiwan Dollar',
'TZS' => 'Tanzanian Shilling',
'THB' => 'Thai Baht',
'TOP' => 'Tonga Paanga',
'TTD' => 'Trinidad & Tobago Dollar',
'TND' => 'Tunisian Dinar',
'TRL' => 'Turkish Lira',
'USD' => 'selected>U.S. Dollar',
'AED' => 'UAE Dirham',
'AFN' => 'USD/AFN',
'ATS' => 'USD/ATS',
'BEF' => 'USD/BEF',
'BGL' => 'USD/BGN',
'CDF' => 'USD/CDF',
'DEM' => 'USD/DEM',
'ESP' => 'USD/ESP',
'FIM' => 'USD/FIM',
'FRF' => 'USD/FRF',
'GEL' => 'USD/GEL',
'GRD' => 'USD/GRD',
'GWP' => 'USD/GWP',
'IEP' => 'USD/IEP',
'ITL' => 'USD/ITL',
'KGS' => 'USD/KGS',
'MGA' => 'USD/MGA',
'NLG' => 'USD/NLG',
'PTE' => 'USD/PTE',
'RON' => 'USD/RON',
'TJS' => 'USD/TJS',
'TMM' => 'USD/TMM',
'TRY' => 'USD/TRY',
'UZS' => 'USD/UZS',
'UGX' => 'Ugandan Shilling',
'UAH' => 'Ukraine Hryvnia',
'UYU' => 'Uruguayan New Peso',
'VUV' => 'Vanuatu Vatu',
'VEB' => 'Venezuelan Bolivar',
'VND' => 'Vietnam Dong',
'XEU' => 'XEU/USD',
'YER' => 'Yemen Riyal',
'ZMK' => 'Zambian Kwacha',
'ZWD' => 'Zimbabwe Dollar');
$Convert = $_REQUEST['Convert'];
if ($Convert==1) {
$convert = file("http://quote.yahoo.com/m5?a=".$_REQUEST['a']."&s=".$_REQUEST['s']."&t=".$_REQUEST['t']."&c=".$_REQUEST['c']."");
$convert = join("",$convert);
$convert = ereg_replace(".*<table border=1 cellpadding=2 cellspacing=0>",'',$convert);
$convert = ereg_replace("</table>.*",'',$convert);
$convert = ereg_replace("</b>.*",'',$convert);
$convert = ereg_replace(".*<b>",'',$convert);
echo $_REQUEST['a']." ".$_REQUEST['s']." is ".$convert." ".$_REQUEST['t'];
}
?>
<form action="cc.php" method="post">
<table>
<tr>
<td><b>Convert</b></td><td>
<input name="a" size="7" value="1"></td><td>
<select name="s">
<?
foreach ($currency as $k => $v) {
echo "<option value=\"$k\">$v ($k)</option>\n";
}
?>
</select>
</td><td><b>into</b></td><td>
<select name="t">
<?
foreach ($currency as $k => $v) {
echo "<option value=\"$k\">$v ($k)</option>\n";
}
?>
</select>
</td></tr>
<input name="Convert" type="hidden" value="1">
<input name="c" type="hidden" value="0">
</table>
<input type="submit" value="Convert it!">
</form>
</body>
</html>