Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/01/2013, 15:10
conceptuando
 
Fecha de Ingreso: enero-2013
Mensajes: 43
Antigüedad: 11 años, 3 meses
Puntos: 0
Respuesta: Suma de resultados if

La respuesta de los includes es la tengo que sumar y quedar impreso en otro formulario: Gracias de nuevo y siento no haberme expicado bien, espero que ahora si lo haya hecho.

Este es el codigo:

HTML:

<tr>
<td>Sitio</td>
<td><?= number_format($numero_1,2,',','.')?></td>
<td><?= round($valor)?></td>
<td><?php include("includes/archivo.php"); ?></td>/*este */
</tr>
<tr>
<td>Sitio</td>
<td><?= number_format($numero1_1,2,',','.')?></td>
<td><?= round($valor1)?></td>
<td><?php include("includes/archivo1.php"); ?></td>/*y este */
</tr>

PHP archivo.php:

<?php
$variable0 = 0;
$variable1_1 = 1;
$variable1_2 = 2;

if ($cajas == 0) {
echo $variable1_0;
} elseif ($cajas1 <= 16){
echo $variable1_1;
} else {
echo $variable1_2;
}
?>

PHP archivo1.php:

<?php
$variable0 = 0;
$variable1_1 = 1;
$variable1_2 = 2;

if ($cajas1 == 0) {
echo $variable1_0;
} elseif ($cajas1 <= 16){
echo $variable1_1;
} else {
echo $variable1_2;
}
?>