ciao a tutti, ho fatto questo semplice giocattolo come convertitore di valuta, ma ho due problemi
1) vorrei che i tassi di cambio eurouno, eurodue, eurotre,dollarouno,dollarodue, pounduno si aggiornassero atomaticamente magari prendendoli da qualche server preposto, ma non ho esperienza
2) far funzionare in locale lo script ( che in remoto su server web funziona, ma in localhost con easyphp, mi da questo errore al posto dei risultati....
Notice: Undefined variable: dollarinseriti in c:\program files\easyphp1-8\www\cc.php on line 66
0,00
<?php
$eurouno = "1.47";
$eurodue = "0.79";
$eurotre = "173";
$dollarouno = "0.54";
$dollarodue = "118";
$pounduno = "218";
?>
<html>
<head>
<title>Currency converter</title>
</head>
<body>
<div align="center"><font size="20" face="arial">CURRENCY CONVERTER
</font></div>
<form method=post action=cc.php>
<table width="717" height="207" border="1" align="center">
<tr>
<td height="51" width="118"></td>
<td height="51" width="119">type currency to convert here</td>
<td height="51" width="119" align="center"><font color="#0000FF">EURO</font></td>
<td height="51" width="119" align="center"><font color="#FF0000">USD
DOLLARS</font></td>
<td height="51" width="119" align="center"><font color="#808080">
POUND</font></td>
<td height="51" width="119" align="center"><font color="#008000">
NAIRA</font></td>
</tr>
<tr>
<td height="52" width="118" align="center"><font color="#0000FF">EURO</font></td>
<td height="52" width="119"> <input size='10' name='euroinseriti' value='<? echo $euroinseriti; ?>'> </td>
<td height="52" width="119">
<?php
$euroinseriti1 = number_format ($euroinseriti, 2, ',', '.' );
echo "$euroinseriti1";
?>
</td>
<td height="52" width="119">
<?php
$euroindollari = $euroinseriti*$eurouno ;
$euroindollari1 = number_format ($euroindollari, 2, ',', '.' );
print("$euroindollari1");
?>
</td>
<td height="52" width="119"><?php
$euro2pound = $euroinseriti/$eurodue ;
$euro2pound1 = number_format ($euro2pound, 2, ',', '.' );
print("$euro2pound1");
?>
</td>
<td height="52" width="119"><?php
$euro2naira = $euroinseriti*$eurotre ;
$euro2naira1 = number_format ($euro2naira, 2, ',', '.' );
print("$euro2naira1");
?></td>
</tr>
<tr>
<td height="52" width="118" align="center"><font color="#FF0000">USD
DOLLARS</font></td>
<td height="52" width="119"> <input size='10' name='dollarinseriti' value='<? echo $dollarinseriti; ?>'> </td>
<td height="52" width="119"><?php
$dollari2euro = $dollarinseriti/$eurouno ;
$dollari2euro1 = number_format ($dollari2euro, 2, ',', '.' );
print("$dollari2euro1");
?></td>
<td height="52" width="119">
<?php
$dollarinseriti1 = number_format ($dollarinseriti, 2, ',', '.' );
echo "$dollarinseriti1";
?>
</td>
<td height="52" width="119"><?php
$dollari2pound = $dollarinseriti*$dollarouno ;
print("$dollari2pound");
?></td>
<td height="52" width="119"><?php
$dollari2nai = $dollarinseriti*$dollarodue ;
$dollari2nai1 = number_format ($dollari2nai, 2, ',', '.' );
print("$dollari2nai1");
?></td>
</tr>
<tr>
<td height="52" width="118" align="center"><font color="#808080">
POUND</font></td>
<td height="52" width="119"><input size='10' name='poundinseriti' value='<? echo $poundinseriti; ?>'> </td>
<td height="52" width="119"><?php
$pound2euro = $poundinseriti*$eurodue ;
$pound2euro1 = number_format ($pound2euro, 2, ',', '.' );
print("$pound2euro1");
?></td>
<td height="52" width="119"><?php
$pound2dollar = $poundinseriti/$dollarouno ;
$pound2dollar1 = number_format ($pound2dollar, 2, ',', '.' );
print("$pound2dollar1");
?></td>
<td height="52" width="119">
<?php
$poundinseriti1 = number_format ($poundinseriti, 2, ',', '.' );
echo "$poundinseriti1";
?>
</td>
<td height="52" width="119"><?php
$pound2nai = $poundinseriti*$pounduno ;
$pound2nai1 = number_format ($pound2nai, 2, ',', '.' );
print("$pound2nai1");
?></td>
</tr>
<tr>
<td height="52" width="118" align="center"><font color="#008000">
NAIRA</font></td>
<td height="52" width="119"> <input size='10' name='naireinserite' value='<? echo $naireinserite; ?>'> </td>
<td height="52" width="119"><?php
$nai2euro = $naireinserite*$eurotre ;
$nai2euro1 = number_format ($nai2euro, 2, ',', '.' );
print("$nai2euro1");
?></td>
<td height="52" width="119"><?php
$nai2doll = $naireinserite*$dollarodue ;
$nai2doll1 = number_format ($nai2doll, 2, ',', '.' );
print("$nai2doll1");
?></td>
<td height="52" width="119"><?php
$nai2pound = $naireinserite*$pounduno ;
$nai2pound1 = number_format ($nai2pound, 2, ',', '.' );
print("$nai2pound1");
?></td>
<td height="52" width="119">
<?php
$naireinserite1 = number_format ($naireinserite, 2, ',', '.' );
echo "$naireinserite1";
?>
</td>
</tr>
</table>
<div align="center">
<input type='submit' name='cc' value=' convert now '>
</p>
</div>
</form>
</body>
</html>