Ver Mensaje Individual
  #11 (permalink)  
Antiguo 14/02/2008, 09:03
ARAPSPGON
 
Fecha de Ingreso: octubre-2007
Mensajes: 57
Antigüedad: 17 años, 7 meses
Puntos: 0
Re: (DUDA principiante) importar resultados de una pagina ASP en una pag html

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> &nbsp;</div></b></td>
    <
td width="266"><b>
    <
div align="rigth"><font color="#0000CC" size="-1" face="Arial, Helvetica, sans-serif">Moneda Destino</font>&nbsp;</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>
    &
nbsp;</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>
    &
nbsp;</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> &nbsp;</div></b></td>
    <
td width="366"><b>
    <
div align="rigth"><font color="#0000CC" size="-1" face="Arial, Helvetica, sans-serif">AL CAMBIO:</font>&nbsp;</div></b></td>
  </
tr>
  <
tr>
    <
td>
    <
div align="rigth">
    <
input type="text" name="cantidad" size="20">
    &
nbsp;</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=and destino=1 then
        total
=cdbl(cantidad)*1
        
else
            if 
origen=and destino=2 then
                total
=cdbl(cantidad)*166.39
            
else
                if 
origen=and destino=3 then
                    total
=cdbl(cantidad)*1.46
                
else
                    if 
origen=and destino=1 then 
                        total
=cdbl(cantidad)*0.006
                        
else
                            if 
origen=and destino=2 then 
                                total
=cdbl(cantidad)*1
                            
else
                                if 
origen=and destino=3 then 
                                    total
=cdbl(cantidad)*0.008
                                
else
                                    if 
origen=and destino=1 then 
                                        total
=cdbl(cantidad)*0.68
                                    
else
                                        if 
origen=and destino=2 then 
                                            total
=cdbl(cantidad)*114.1
                                        
else
                                        if 
origen=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>
    &
nbsp;</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=and destino=1 then
        response
.write("Su conversión no tiene sentido")
        else
            if 
origen=and destino=2 then
                response
.Write("1 Euro equivale a 166.39 Pesetas")
            else
                if 
origen=and destino=3 then
                    response
.write("1 Euro equivale a 1.46 Dólares")
                else
                    if 
origen=and destino=1 then 
                        response
.write("1 Peseta equivale a 0.006 Euros")
                        else
                            if 
origen=and destino=2 then 
                                response
.write("Su conversión no tiene sentido")
                            else
                                if 
origen=and destino=3 then 
                                    response
.write("1 Peseta equivale a 0.008 Dólares")
                                else
                                    if 
origen=and destino=1 then 
                                        response
.write("1 Dólar equivale a 0.68 Euros")
                                    else
                                        if 
origen=and destino=2 then 
                                            response
.write("1 Dólar equivale a 114.1 Pesetas")
                                        else
                                        if 
origen=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>&nbsp;</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

Última edición por ARAPSPGON; 14/02/2008 a las 09:14