Hi all,
I am doing a Conversion rate program. The outcome is always O instead of the rate. I have arrays... I think the problem is in the echo line with my variables. can someon take a look and let me know?
code is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Exchange Calculator</title>
</head>
<body>
<?PHP
$currency = array (
"US $",
"Yen",
"Euro",
"Pound",
"Canadian $",
"Swiss Franc",
);
$exchangeRates = array (
array (1, 104.61, 0.7476, 0.5198, 1.2013, 1,1573),
array (0.009559, 1, 0.007146, 0.004969, 0.011484, 0.011063),
array (1.3377, 139.9368, 1, 0.6953, 1.6070, 1.5481),
array (1.9239, 201.2592, 1.4382, 1, 2.3112, 2.2265),
array (0.8324, 87.0807, 0.6223, 0.4327, 1, 0.9634),
array (0.8641, 90.3914, 0.6459, 0.4491, 1.0380, 1)
);
$result = $_REQUEST{"amount"} * $exchangeRates{$_REQUEST("$currencyA")}
{$_REQUEST("$currencyB")}
$currentcurrency = ["$currencyA"] [$currencyB];
echo "<h3>The Currency conversion is " ";
echo "$currentcurrency</h3>";
</body>
</html>