![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
03/11/2009, 11:09
|
![Avatar de dcreate](http://static.forosdelweb.com/customavatars/avatar326327_7.gif) | | | Fecha de Ingreso: octubre-2009 Ubicación: Veracruz
Mensajes: 536
Antigüedad: 15 años, 3 meses Puntos: 22 | |
Respuesta: Casillas que calculan resultados a lo mejor seria asi: Cita: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<?php
if(empty($_POST['submit']))
{?>
<form id="form1" name="form1" method="post" action="mostrar_lista.php">
<label>
<input type="checkbox" name="checkbox" value="2" />
2 comensales</label>
<p>
<label>
<input type="checkbox" name="checkbox2" value="3" />
</label>
3
comensales</p>
<p>
<label>
<input type="submit" name="Submit" value="Enviar" />
</label>
</p>
</form>
<?php }else{
$comen1=$_POST['checkbox'];
$comen2=$_POST['checkbox2'];
if(isset($_POST['checkbox'];))
{
$aux=$total*$comen1;
}
elseif(isset($_POST['checkbox2'];))
{
$aux=$total*$comen2;
}
else
{
$aux=$total;
}
echo '<input type="text" name="total" value="'.$aux.'">';
}?>
</body>
</html> |