Просмотр файла currency.php

Размер файла: 15.65Kb
Преобразование Валюты:<hr/>
<?php
	if(!empty($_POST['number']) and $_POST['currency_from']!=$_POST['currency_to'])
	{
		$from   = $_POST['currency_from'];
		$to     = $_POST['currency_to'];
		$url = 'http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s='. $from . $to .'=X';
		$handle = @fopen($url, 'r');
		 
		if ($handle) {
			$result = fgets($handle, 4096);
			fclose($handle);
		}
		
		$allData = explode(',',$result);
		$dollarValue = $allData[1];
		 
		echo '<b>'.round($_POST['number'], 2).'</b> '.htmlspecialchars($_POST['currency_from']).' - <b>'.round($_POST['number']*$dollarValue, 2).'</b> '.htmlspecialchars($_POST['currency_to']).'<hr/>';
	}
	
?>

<form action="currency.php" method="post">
	от:<br/><select name="currency_from">
	<OPTION value="USD">U.S. Dollar (USD)</OPTION><OPTION value="EUR">Euro(EUR)</OPTION><OPTION value="RUB">Russian Rouble(RUB)</OPTION><OPTION value="ALL">Albanian Lek(ALL)</OPTION><OPTION value="DZD">Algerian Dinar(DZD)</OPTION><OPTION value="XAL">Aluminium Ounces(XAL)</OPTION><OPTION value="ARS">Argentine Peso(ARS)</OPTION><OPTION value="AWG">Aruba Florin(AWG)</OPTION><OPTION value="AUD">Australian Dollar(AUD)</OPTION><OPTION value="BSD">Bahamian Dollar(BSD)</OPTION><OPTION value="BHD">Bahraini Dinar(BHD)</OPTION><OPTION value="BDT">Bangladesh Taka(BDT)</OPTION><OPTION value="BBD">Barbados Dollar(BBD)</OPTION><OPTION value="BYR">Belarus Ruble(BYR)</OPTION><OPTION value="BZD">Belize Dollar(BZD)</OPTION><OPTION value="BMD">Bermuda Dollar(BMD)</OPTION><OPTION value="BTN">Bhutan Ngultrum(BTN)</OPTION><OPTION value="BOB">Bolivian Boliviano(BOB)</OPTION><OPTION value="BWP">Botswana Pula(BWP)</OPTION><OPTION value="BRL">Brazilian Real(BRL)</OPTION><OPTION value="GBP">British Pound(GBP)</OPTION><OPTION value="BND">Brunei Dollar(BND)</OPTION><OPTION value="BGN">Bulgarian Lev(BGN)</OPTION><OPTION value="BIF">Burundi Franc(BIF)</OPTION><OPTION value="KHR">Cambodia Riel(KHR)</OPTION><OPTION value="CAD">Canadian Dollar(CAD)</OPTION><OPTION value="CVE">Cape Verde Escudo(CVE)</OPTION><OPTION value="KYD">Cayman Islands Dollar(KYD)</OPTION><OPTION value="XOF">CFA Franc (BCEAO)(XOF)</OPTION><OPTION value="XAF">CFA Franc (BEAC)(XAF)</OPTION><OPTION value="CLP">Chilean Peso(CLP)</OPTION><OPTION value="CNY">Chinese Yuan(CNY)</OPTION><OPTION value="COP">Colombian Peso(COP)</OPTION><OPTION value="KMF">Comoros Franc(KMF)</OPTION><OPTION value="XCP">Copper Ounces(XCP)</OPTION><OPTION value="CRC">Costa Rica Colon(CRC)</OPTION><OPTION value="HRK">Croatian Kuna(HRK)</OPTION><OPTION value="CUP">Cuban Peso(CUP)</OPTION><OPTION value="CYP">Cyprus Pound(CYP)</OPTION><OPTION value="CZK">Czech Koruna(CZK)</OPTION><OPTION value="DKK">Danish Krone(DKK)</OPTION><OPTION value="DJF">Dijibouti Franc(DJF)</OPTION><OPTION value="DOP">Dominican Peso(DOP)</OPTION><OPTION value="XCD">East Caribbean Dollar(XCD)</OPTION><OPTION value="ECS">Ecuador Sucre(ECS)</OPTION><OPTION value="EGP">Egyptian Pound(EGP)</OPTION><OPTION value="SVC">El Salvador Colon(SVC)</OPTION><OPTION value="ERN">Eritrea Nakfa(ERN)</OPTION><OPTION value="EEK">Estonian Kroon(EEK)</OPTION><OPTION value="ETB">Ethiopian Birr(ETB)</OPTION><OPTION value="FKP">Falkland Islands Pound(FKP)</OPTION><OPTION value="FJD">Fiji Dollar(FJD)</OPTION><OPTION value="GMD">Gambian Dalasi(GMD)</OPTION><OPTION value="GHC">Ghanian Cedi(GHC)</OPTION><OPTION value="GIP">Gibraltar Pound(GIP)</OPTION><OPTION value="XAU">Gold Ounces(XAU)</OPTION><OPTION value="GTQ">Guatemala Quetzal(GTQ)</OPTION><OPTION value="GNF">Guinea Franc(GNF)</OPTION><OPTION value="GYD">Guyana Dollar(GYD)</OPTION><OPTION value="HTG">Haiti Gourde(HTG)</OPTION><OPTION value="HNL">Honduras Lempira(HNL)</OPTION><OPTION value="HKD">Hong Kong Dollar(HKD)</OPTION><OPTION value="HUF">Hungarian Forint(HUF)</OPTION><OPTION value="ISK">Iceland Krona(ISK)</OPTION><OPTION value="INR">Indian Rupee(INR)</OPTION><OPTION value="IDR">Indonesian Rupiah(IDR)</OPTION><OPTION value="IRR">Iran Rial(IRR)</OPTION><OPTION value="IQD">Iraqi Dinar(IQD)</OPTION><OPTION value="ILS">Israeli Shekel(ILS)</OPTION><OPTION value="JMD">Jamaican Dollar(JMD)</OPTION><OPTION value="JPY">Japanese Yen(JPY)</OPTION><OPTION value="JOD">Jordanian Dinar(JOD)</OPTION><OPTION value="KZT">Kazakhstan Tenge(KZT)</OPTION><OPTION value="KES">Kenyan Shilling(KES)</OPTION><OPTION value="KRW">Korean Won(KRW)</OPTION><OPTION value="KWD">Kuwaiti Dinar(KWD)</OPTION><OPTION value="LAK">Lao Kip(LAK)</OPTION><OPTION value="LVL">Latvian Lat(LVL)</OPTION><OPTION value="LBP">Lebanese Pound(LBP)</OPTION><OPTION value="LSL">Lesotho Loti(LSL)</OPTION><OPTION value="LRD">Liberian Dollar(LRD)</OPTION><OPTION value="LYD">Libyan Dinar(LYD)</OPTION><OPTION value="LTL">Lithuanian Lita(LTL)</OPTION><OPTION value="MOP">Macau Pataca(MOP)</OPTION><OPTION value="MKD">Macedonian Denar(MKD)</OPTION><OPTION value="MWK">Malawi Kwacha(MWK)</OPTION><OPTION value="MYR">Malaysian Ringgit(MYR)</OPTION><OPTION value="MVR">Maldives Rufiyaa(MVR)</OPTION><OPTION value="MTL">Maltese Lira(MTL)</OPTION><OPTION value="MRO">Mauritania Ougulya(MRO)</OPTION><OPTION value="MUR">Mauritius Rupee(MUR)</OPTION><OPTION value="MXN">Mexican Peso(MXN)</OPTION><OPTION value="MDL">Moldovan Leu(MDL)</OPTION><OPTION value="MNT">Mongolian Tugrik(MNT)</OPTION><OPTION value="MAD">Moroccan Dirham(MAD)</OPTION><OPTION value="MMK">Myanmar Kyat(MMK)</OPTION><OPTION value="NAD">Namibian Dollar(NAD)</OPTION><OPTION value="NPR">Nepalese Rupee(NPR)</OPTION><OPTION value="ANG">Neth Antilles Guilder(ANG)</OPTION><OPTION value="TRY">New Turkish Lira(TRY)</OPTION><OPTION value="NZD">New Zealand Dollar(NZD)</OPTION><OPTION value="ZWN">New Zimbabwe Dollar(ZWN)</OPTION><OPTION value="NIO">Nicaragua Cordoba(NIO)</OPTION><OPTION value="NGN">Nigerian Naira(NGN)</OPTION><OPTION value="KPW">North Korean Won(KPW)</OPTION><OPTION value="NOK">Norwegian Krone(NOK)</OPTION><OPTION value="OMR">Omani Rial(OMR)</OPTION><OPTION value="XPF">Pacific Franc(XPF)</OPTION><OPTION value="PKR">Pakistani Rupee(PKR)</OPTION><OPTION value="XPD">Palladium Ounces(XPD)</OPTION><OPTION value="PAB">Panama Balboa(PAB)</OPTION><OPTION value="PGK">Papua New Guinea Kina(PGK)</OPTION><OPTION value="PYG">Paraguayan Guarani(PYG)</OPTION><OPTION value="PEN">Peruvian Nuevo Sol(PEN)</OPTION><OPTION value="PHP">Philippine Peso(PHP)</OPTION><OPTION value="XPT">Platinum Ounces(XPT)</OPTION><OPTION value="PLN">Polish Zloty(PLN)</OPTION><OPTION value="QAR">Qatar Rial(QAR)</OPTION><OPTION value="RON">Romanian New Leu(RON)</OPTION><OPTION value="RWF">Rwanda Franc(RWF)</OPTION><OPTION value="WST">Samoa Tala(WST)</OPTION><OPTION value="STD">Sao Tome Dobra(STD)</OPTION><OPTION value="SAR">Saudi Arabian Riyal(SAR)</OPTION><OPTION value="SCR">Seychelles Rupee(SCR)</OPTION><OPTION value="SLL">Sierra Leone Leone(SLL)</OPTION><OPTION value="XAG">Silver Ounces(XAG)</OPTION><OPTION value="SGD">Singapore Dollar(SGD)</OPTION><OPTION value="SKK">Slovak Koruna(SKK)</OPTION><OPTION value="SIT">Slovenian Tolar(SIT)</OPTION><OPTION value="SBD">Solomon Islands Dollar(SBD)</OPTION><OPTION value="SOS">Somali Shilling(SOS)</OPTION><OPTION value="ZAR">South African Rand(ZAR)</OPTION><OPTION value="LKR">Sri Lanka Rupee(LKR)</OPTION><OPTION value="SHP">St Helena Pound(SHP)</OPTION><OPTION value="SDD">Sudanese Dinar(SDD)</OPTION><OPTION value="SZL">Swaziland Lilageni(SZL)</OPTION><OPTION value="SEK">Swedish Krona(SEK)</OPTION><OPTION value="CHF">Swiss Franc(CHF)</OPTION><OPTION value="SYP">Syrian Pound(SYP)</OPTION><OPTION value="TWD">Taiwan Dollar(TWD)</OPTION><OPTION value="TZS">Tanzanian Shilling(TZS)</OPTION><OPTION value="THB">Thai Baht(THB)</OPTION><OPTION value="TOP">Tonga Pa'anga(TOP)</OPTION><OPTION value="TTD">Trinidad&Tobago Dollar(TTD)</OPTION><OPTION value="TND">Tunisian Dinar(TND)</OPTION><OPTION value="AED">UAE Dirham(AED)</OPTION><OPTION value="UGX">Ugandan Shilling(UGX)</OPTION><OPTION value="UAH">Ukraine Hryvnia(UAH)</OPTION><OPTION value="UYU">Uruguayan New Peso(UYU)</OPTION><OPTION value="VUV">Vanuatu Vatu(VUV)</OPTION><OPTION value="VEB">Venezuelan Bolivar(VEB)</OPTION><OPTION value="VND">Vietnam Dong(VND)</OPTION><OPTION value="YER">Yemen Riyal(YER)</OPTION><OPTION value="ZMK">Zambian Kwacha(ZMK)</OPTION><OPTION value="ZWD">Zimbabwe Dollar(ZWD)</OPTION>
	</select><br/>
	в:<br/><select name="currency_to">
		<OPTION value="EUR">Euro(EUR)</OPTION><OPTION value="USD">U.S. Dollar(USD)</OPTION><OPTION value="RUB">Russian Rouble(RUB)</OPTION><OPTION value="MYR">Malaysian Ringgit (MYR)</OPTION><OPTION value="ALL">Albanian Lek(ALL)</OPTION><OPTION value="DZD">Algerian Dinar(DZD)</OPTION><OPTION value="XAL">Aluminium Ounces(XAL)</OPTION><OPTION value="ARS">Argentine Peso(ARS)</OPTION><OPTION value="AWG">Aruba Florin(AWG)</OPTION><OPTION value="AUD">Australian Dollar(AUD)</OPTION><OPTION value="BSD">Bahamian Dollar(BSD)</OPTION><OPTION value="BHD">Bahraini Dinar(BHD)</OPTION><OPTION value="BDT">Bangladesh Taka(BDT)</OPTION><OPTION value="BBD">Barbados Dollar(BBD)</OPTION><OPTION value="BYR">Belarus Ruble(BYR)</OPTION><OPTION value="BZD">Belize Dollar(BZD)</OPTION><OPTION value="BMD">Bermuda Dollar(BMD)</OPTION><OPTION value="BTN">Bhutan Ngultrum(BTN)</OPTION><OPTION value="BOB">Bolivian Boliviano(BOB)</OPTION><OPTION value="BWP">Botswana Pula(BWP)</OPTION><OPTION value="BRL">Brazilian Real(BRL)</OPTION><OPTION value="GBP">British Pound(GBP)</OPTION><OPTION value="BND">Brunei Dollar(BND)</OPTION><OPTION value="BGN">Bulgarian Lev(BGN)</OPTION><OPTION value="BIF">Burundi Franc(BIF)</OPTION><OPTION value="KHR">Cambodia Riel(KHR)</OPTION><OPTION value="CAD">Canadian Dollar(CAD)</OPTION><OPTION value="CVE">Cape Verde Escudo(CVE)</OPTION><OPTION value="KYD">Cayman Islands Dollar(KYD)</OPTION><OPTION value="XOF">CFA Franc (BCEAO)(XOF)</OPTION><OPTION value="XAF">CFA Franc (BEAC)(XAF)</OPTION><OPTION value="CLP">Chilean Peso(CLP)</OPTION><OPTION value="CNY">Chinese Yuan(CNY)</OPTION><OPTION value="COP">Colombian Peso(COP)</OPTION><OPTION value="KMF">Comoros Franc(KMF)</OPTION><OPTION value="XCP">Copper Ounces(XCP)</OPTION><OPTION value="CRC">Costa Rica Colon(CRC)</OPTION><OPTION value="HRK">Croatian Kuna(HRK)</OPTION><OPTION value="CUP">Cuban Peso(CUP)</OPTION><OPTION value="CYP">Cyprus Pound(CYP)</OPTION><OPTION value="CZK">Czech Koruna(CZK)</OPTION><OPTION value="DKK">Danish Krone(DKK)</OPTION><OPTION value="DJF">Dijibouti Franc(DJF)</OPTION><OPTION value="DOP">Dominican Peso(DOP)</OPTION><OPTION value="XCD">East Caribbean Dollar(XCD)</OPTION><OPTION value="ECS">Ecuador Sucre(ECS)</OPTION><OPTION value="EGP">Egyptian Pound(EGP)</OPTION><OPTION value="SVC">El Salvador Colon(SVC)</OPTION><OPTION value="ERN">Eritrea Nakfa(ERN)</OPTION><OPTION value="EEK">Estonian Kroon(EEK)</OPTION><OPTION value="ETB">Ethiopian Birr(ETB)</OPTION><OPTION value="FKP">Falkland Islands Pound(FKP)</OPTION><OPTION value="FJD">Fiji Dollar(FJD)</OPTION><OPTION value="GMD">Gambian Dalasi(GMD)</OPTION><OPTION value="GHC">Ghanian Cedi(GHC)</OPTION><OPTION value="GIP">Gibraltar Pound(GIP)</OPTION><OPTION value="XAU">Gold Ounces(XAU)</OPTION><OPTION value="GTQ">Guatemala Quetzal(GTQ)</OPTION><OPTION value="GNF">Guinea Franc(GNF)</OPTION><OPTION value="GYD">Guyana Dollar(GYD)</OPTION><OPTION value="HTG">Haiti Gourde(HTG)</OPTION><OPTION value="HNL">Honduras Lempira(HNL)</OPTION><OPTION value="HKD">Hong Kong Dollar(HKD)</OPTION><OPTION value="HUF">Hungarian Forint(HUF)</OPTION><OPTION value="ISK">Iceland Krona(ISK)</OPTION><OPTION value="INR">Indian Rupee(INR)</OPTION><OPTION value="IDR">Indonesian Rupiah(IDR)</OPTION><OPTION value="IRR">Iran Rial(IRR)</OPTION><OPTION value="IQD">Iraqi Dinar(IQD)</OPTION><OPTION value="ILS">Israeli Shekel(ILS)</OPTION><OPTION value="JMD">Jamaican Dollar(JMD)</OPTION><OPTION value="JPY">Japanese Yen(JPY)</OPTION><OPTION value="JOD">Jordanian Dinar(JOD)</OPTION><OPTION value="KZT">Kazakhstan Tenge(KZT)</OPTION><OPTION value="KES">Kenyan Shilling(KES)</OPTION><OPTION value="KRW">Korean Won(KRW)</OPTION><OPTION value="KWD">Kuwaiti Dinar(KWD)</OPTION><OPTION value="LAK">Lao Kip(LAK)</OPTION><OPTION value="LVL">Latvian Lat(LVL)</OPTION><OPTION value="LBP">Lebanese Pound(LBP)</OPTION><OPTION value="LSL">Lesotho Loti(LSL)</OPTION><OPTION value="LRD">Liberian Dollar(LRD)</OPTION><OPTION value="LYD">Libyan Dinar(LYD)</OPTION><OPTION value="LTL">Lithuanian Lita(LTL)</OPTION><OPTION value="MOP">Macau Pataca(MOP)</OPTION><OPTION value="MKD">Macedonian Denar(MKD)</OPTION><OPTION value="MWK">Malawi Kwacha(MWK)</OPTION><OPTION value="MYR">Malaysian Ringgit(MYR)</OPTION><OPTION value="MVR">Maldives Rufiyaa(MVR)</OPTION><OPTION value="MTL">Maltese Lira(MTL)</OPTION><OPTION value="MRO">Mauritania Ougulya(MRO)</OPTION><OPTION value="MUR">Mauritius Rupee(MUR)</OPTION><OPTION value="MXN">Mexican Peso(MXN)</OPTION><OPTION value="MDL">Moldovan Leu(MDL)</OPTION><OPTION value="MNT">Mongolian Tugrik(MNT)</OPTION><OPTION value="MAD">Moroccan Dirham(MAD)</OPTION><OPTION value="MMK">Myanmar Kyat(MMK)</OPTION><OPTION value="NAD">Namibian Dollar(NAD)</OPTION><OPTION value="NPR">Nepalese Rupee(NPR)</OPTION><OPTION value="ANG">Neth Antilles Guilder(ANG)</OPTION><OPTION value="TRY">New Turkish Lira(TRY)</OPTION><OPTION value="NZD">New Zealand Dollar(NZD)</OPTION><OPTION value="ZWN">New Zimbabwe Dollar(ZWN)</OPTION><OPTION value="NIO">Nicaragua Cordoba(NIO)</OPTION><OPTION value="NGN">Nigerian Naira(NGN)</OPTION><OPTION value="KPW">North Korean Won(KPW)</OPTION><OPTION value="NOK">Norwegian Krone(NOK)</OPTION><OPTION value="OMR">Omani Rial(OMR)</OPTION><OPTION value="XPF">Pacific Franc(XPF)</OPTION><OPTION value="PKR">Pakistani Rupee(PKR)</OPTION><OPTION value="XPD">Palladium Ounces(XPD)</OPTION><OPTION value="PAB">Panama Balboa(PAB)</OPTION><OPTION value="PGK">Papua New Guinea Kina(PGK)</OPTION><OPTION value="PYG">Paraguayan Guarani(PYG)</OPTION><OPTION value="PEN">Peruvian Nuevo Sol(PEN)</OPTION><OPTION value="PHP">Philippine Peso(PHP)</OPTION><OPTION value="XPT">Platinum Ounces(XPT)</OPTION><OPTION value="PLN">Polish Zloty(PLN)</OPTION><OPTION value="QAR">Qatar Rial(QAR)</OPTION><OPTION value="RON">Romanian New Leu(RON)</OPTION><OPTION value="RWF">Rwanda Franc(RWF)</OPTION><OPTION value="WST">Samoa Tala(WST)</OPTION><OPTION value="STD">Sao Tome Dobra(STD)</OPTION><OPTION value="SAR">Saudi Arabian Riyal(SAR)</OPTION><OPTION value="SCR">Seychelles Rupee(SCR)</OPTION><OPTION value="SLL">Sierra Leone Leone(SLL)</OPTION><OPTION value="XAG">Silver Ounces(XAG)</OPTION><OPTION value="SGD">Singapore Dollar(SGD)</OPTION><OPTION value="SKK">Slovak Koruna(SKK)</OPTION><OPTION value="SIT">Slovenian Tolar(SIT)</OPTION><OPTION value="SBD">Solomon Islands Dollar(SBD)</OPTION><OPTION value="SOS">Somali Shilling(SOS)</OPTION><OPTION value="ZAR">South African Rand(ZAR)</OPTION><OPTION value="LKR">Sri Lanka Rupee(LKR)</OPTION><OPTION value="SHP">St Helena Pound(SHP)</OPTION><OPTION value="SDD">Sudanese Dinar(SDD)</OPTION><OPTION value="SZL">Swaziland Lilageni(SZL)</OPTION><OPTION value="SEK">Swedish Krona(SEK)</OPTION><OPTION value="CHF">Swiss Franc(CHF)</OPTION><OPTION value="SYP">Syrian Pound(SYP)</OPTION><OPTION value="TWD">Taiwan Dollar(TWD)</OPTION><OPTION value="TZS">Tanzanian Shilling(TZS)</OPTION><OPTION value="THB">Thai Baht(THB)</OPTION><OPTION value="TOP">Tonga Pa'anga(TOP)</OPTION><OPTION value="TTD">Trinidad&Tobago Dollar(TTD)</OPTION><OPTION value="TND">Tunisian Dinar(TND)</OPTION><OPTION value="AED">UAE Dirham(AED)</OPTION><OPTION value="UGX">Ugandan Shilling(UGX)</OPTION><OPTION value="UAH">Ukraine Hryvnia(UAH)</OPTION><OPTION value="UYU">Uruguayan New Peso(UYU)</OPTION><OPTION value="VUV">Vanuatu Vatu(VUV)</OPTION><OPTION value="VEB">Venezuelan Bolivar(VEB)</OPTION><OPTION value="VND">Vietnam Dong(VND)</OPTION><OPTION value="YER">Yemen Riyal(YER)</OPTION><OPTION value="ZMK">Zambian Kwacha(ZMK)</OPTION><OPTION value="ZWD">Zimbabwe Dollar(ZWD)</OPTION>
	</select>
	<hr/>
	Количество:<br/><input type="text" name="number" /><br/>
	<input type="submit" value="конверт" />
</form>