
grcias Shiryu_Libra
funciona ok el codigo
le he hecho una serie de modificaciones para perfeccionarlo aqui lo tienes...
guardalo con el nombre "conversor.asp" y modifica la ruta del action para adaptarlo a tu directorio virtual
Código PHP:
<html>
<head>
<title>Conversor</title>
</head>
<body bgcolor="#CCCC66">
<center>
<b><u>
<font color="#000066" size="+2" face="Arial, Helvetica, sans-serif">
CAMBIO DE MONEDA
</font>
</u></b>
</center><br>
<FORM action="/scripts/ejemplos/conversor.asp" method="POST">
<table width="543" height="58" border="0" align="center">
<tr>
<td width="267"><b>
<div align="rigth"><font color="#0000CC" size="-1" face="Arial, Helvetica, sans-serif">Moneda Origen</font> </div></b></td>
<td width="266"><b>
<div align="rigth"><font color="#0000CC" size="-1" face="Arial, Helvetica, sans-serif">Moneda Destino</font> </div></b></td>
</tr>
<tr>
<td>
<div align="rigth">
<select name="origen" size="1">
<option value="1" selected="selected"> EUROS </option>
<option value="2" > PESETAS </option>
<option value="3" > DOLARES </option>
</select></div></td>
<td>
<div align="rigth">
<select name="destino" size="1">
<option value="1" > EUROS </option>
<option value="2" selected="selected"> PESETAS </option>
<option value="3" > DOLARES </option>
</select></div></td>
</tr>
</table>
<table width="543" height="58" border="0" align="center">
<tr>
<td width="169"><b>
<div align="rigth"><font color="#0000CC" size="-1" face="Arial, Helvetica, sans-serif">INTRODUZCA CANTIDAD</font> </div></b></td>
<td width="366"><b>
<div align="rigth"><font color="#0000CC" size="-1" face="Arial, Helvetica, sans-serif">AL CAMBIO:</font> </div></b></td>
</tr>
<tr>
<td>
<div align="rigth">
<input type="text" name="cantidad" size="20">
</div>
</td>
<td bgcolor="#FFFFFF">
<div align="rigth">
<b>
<font color="#FF0000" size="-1" face="Arial, Helvetica, sans-serif">
<%
if request.ServerVariables("REQUEST_METHOD")="POST" then
origen = request.Form("origen")
destino = request.Form("destino")
cantidad = request.Form("cantidad")
select case origen
case 1 respuesta1 = "Tus " & cantidad & " Euros equivalen a "
case 2 respuesta1 = "Tus " & cantidad & " Pesetas equivalen a "
case 3 respuesta1 = "Tus " & cantidad & " Dolares equivalen a "
end select
if origen=1 and destino=1 then
total=cdbl(cantidad)*1
else
if origen=1 and destino=2 then
total=cdbl(cantidad)*166.39
else
if origen=1 and destino=3 then
total=cdbl(cantidad)*1.46
else
if origen=2 and destino=1 then
total=cdbl(cantidad)*0.006
else
if origen=2 and destino=2 then
total=cdbl(cantidad)*1
else
if origen=2 and destino=3 then
total=cdbl(cantidad)*0.008
else
if origen=3 and destino=1 then
total=cdbl(cantidad)*0.68
else
if origen=3 and destino=2 then
total=cdbl(cantidad)*114.1
else
if origen=3 and destino=3 then
total=cdbl(cantidad)*1
end if
end if
end if
end if
end if
end if
end if
end if
end if
select case destino
case 1 respuesta2 = total & " Euros"
case 2 respuesta2 = total & " Pesetas"
case 3 respuesta2 = total & " Dolares"
end select
response.Write respuesta1 & respuesta2
end if
%>
</font>
</b>
</div>
</td>
</tr>
</table>
<br><br><div align="center"><input type="submit" value="CONVERTIR"></div>
</FORM>
<table width="251" height="58" border="0" align="center">
<tr>
<td width="266"><b>
<div align="center"><font color="#FF0000" size="-1" face="Arial, Helvetica, sans-serif">
<%
if request.ServerVariables("REQUEST_METHOD")="POST" then
origen = request.Form("origen")
destino = request.Form("destino")
if origen=1 and destino=1 then
response.write("Su conversión no tiene sentido")
else
if origen=1 and destino=2 then
response.Write("1 Euro equivale a 166.39 Pesetas")
else
if origen=1 and destino=3 then
response.write("1 Euro equivale a 1.46 Dólares")
else
if origen=2 and destino=1 then
response.write("1 Peseta equivale a 0.006 Euros")
else
if origen=2 and destino=2 then
response.write("Su conversión no tiene sentido")
else
if origen=2 and destino=3 then
response.write("1 Peseta equivale a 0.008 Dólares")
else
if origen=3 and destino=1 then
response.write("1 Dólar equivale a 0.68 Euros")
else
if origen=3 and destino=2 then
response.write("1 Dólar equivale a 114.1 Pesetas")
else
if origen=3 and destino=3 then
response.write("Su conversión no tiene sentido")
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
%>
</font> </div></b></td>
</tr>
</table>
<br><br><b><div align="center"><font color="#FF0000" size="-1" face="Arial, Helvetica, sans-serif">Fecha: <% response.write date()%></font></div></b>
</body>
</html>