Ver Mensaje Individual
  #7 (permalink)  
Antiguo 13/10/2015, 08:42
sebastopolys
 
Fecha de Ingreso: enero-2011
Mensajes: 13
Antigüedad: 13 años, 3 meses
Puntos: 0
Respuesta: Aplicar CSS a php o enviar variables de php a html

Les muestro lo que hice... a ver que tan mal está :)


Este es el html

Código:
<!DOCTYPE html>
   
<html lang=es>
<head>
	<title>Conversor pesos argentinos a dolares	</title>
	<link rel="stylesheet" href="./style.css" type="text/css" media="all" />
</head>
<body>
	<main>
		<h1>Conversor de pesos argentinos a dolares y dolares a pesos argentinos</h1>
		<form action="convert.php" method="post">
						<label for="CONV">Ingresar valor:</label>
						<input type="text" class="CONV" name="CONVar" placeholder="Pesos Argentinos">
						<input type="text" class="CONV" name="CONVdo" placeholder="Dolares">
						<input type="submit" value="convertir" id="botonsubmit">
		</form>
		<h4>Segun datos actualizados automaticamente y tomados de Prensa (La Nacion)</h4>
	
		</main>	
		
</body>
</html>

y este es el archivo convert.php



Código:

<?php
 $camblu = 15;
 $cambof = 10;
 
 /*cambio ARS a USD*/	
$conva = $_POST['CONVar']; 
        
$dblu = $conva / $camblu;
$dofi = $conva / $cambof;


	


/*cambio USD a ARS*/
$convd = $_POST['CONVdo'];

$convarb = $convd * $camblu;
$convaro = $convd  * $cambof;



//ingresar datos correctamente

If (empty($_POST['CONVar']) && empty($_POST['CONVdo'])) 
{
	echo"Ingrese un solo valor. Dolar o Peso Argentino 1"."<br/>";
}
elseif (!empty($_POST['CONVar']) && !empty($_POST['CONVdo']))
{
	echo"Ingrese un solo valor. Dolar o Peso Argentino 2"."<br/>";
}
	
else {
	
//mostrar cambio de ARS a USD

If (isset	($_POST['CONVar']) && empty($_POST['CONVdo']))		
	
	{

echo $conva." Pesos Argentinos equivalen a:"."<br/>";
echo round($dofi,2)." US$ a cambio oficial"."<br/>";
echo round ($dblu,2)." US$ a cambio paralelo(dolar blue)";
}

//mostrar cambio de USD a ARS

If (isset	($_POST['CONVdo']) && empty($_POST['CONVar']))
	
	{

echo $convd." Dolares equivalen a:"."<br/>";
echo round($convaro,2)." Pesos Argentinos a cambio oficial"."<br/>";
echo round ($convarb,2)." Pesos Argentinos a cambio paralelo(dolar blue)";
}}


echo "<br/>".'<a href="index_Convert.html">Ingresar valores nuevamente</a>';




?>