Ver Mensaje Individual
  #5 (permalink)  
Antiguo 14/05/2008, 22:27
Avatar de bLEx
bLEx
 
Fecha de Ingreso: mayo-2008
Ubicación: Villa Alemana, Chile
Mensajes: 181
Antigüedad: 16 años
Puntos: 5
Re: (Ayuda) Condicion if

Bueno tu switch si no me falla tendria que ser algo asi...

Código HTML:
<form action="imc.php" method="POST" name="imc">
Peso <input type="text" name="peso" size="10"><br />
Talla <input type="text" name="talla" size="10"><br />
<input type="submit" name="enviar" value="Enviar"><br />
</form>
Tu IMC es:
Código PHP:
<?php
if (isset($_POST['enviar'])){
  
$peso $_POST['peso'];
  
$talla $_POST['talla'];
  
$total = ($peso / ($talla $talla));
  echo 
round ($total1);

  if(
$total 18.5){
    echo 
"Bajo peso";
  }else if(
$total 25){
    echo 
"Normal";
  }else if (
$total 30){
    echo 
"sobrepeso";
  }else if (
$total 35){
    echo 
"Obeso";
  }else{
    echo 
"Obeso Clinico";
  }

?>
mmm haber prueba con eso