Código PHP:
Ver original
echo "<td><input type='text' name='cantidad[]' size='4' maxlength='3' value='1'></td>";
Cuando los recibo los recibo asi
$cant = array($_POST['cantidad']);
el punto es que estoy construyendo una tabla tambien una tabla a partir de una consulta que hago a la base de datos y es así:
Código PHP:
Ver original
$tablahtml=''; $tablahtml.="<table >"; $tablahtml.="<tr ><td><div style='align:center; background-color:#FF8000; color: #fffff; font-weight: bold;'>Módulo</div></td>"; $tablahtml.="<td><div style='align:center; background-color:#FF8000; color: #fffff; font-weight: bold;'>Cantidad</div></td>"; $tablahtml.="<td><div style='align:center; background-color:#FF8000; color: #fffff; font-weight: bold;'>Valor</div></td></tr>"; $tablahtml.="<tr><td>$row[1]</td>"; $valor = $row[2] * $vr_hora; //armamos el array para el total de horas $horasd[] = $row[2]; //convertimos valor a miles //Armamos el array para sumar el valor total $precio[] = $row[2] * $vr_hora; $tablahtml.="<td><div align='right'>$valor1_mil</div></td></tr>"; } //calculamos los dias de desarrollo if ($totalhoras < 8 ) { $as = 'horas'; $hou = $totalhoras; } elseif($totalhoras > 30) { $messi = $totalhoras/30; $hou = $mesd; $as = 'meses'; } else { $as = 'dias hábiles'; $hou = $totalhoras; } $tablahtml.="<tr><td><div style='background-color: #FAAC58; font-weight: bold;'>Valor de la Inversión</td>"; $tablahtml.="<td><div style='background-color: #FAAC58; font-weight: bold;'>$invmil</td>"; $tablahtml.="<tr><td><div style='font-weight: bold;'>Tiempo de Desarrollo</td>"; $tablahtml.="<td><div style='font-weight: bold;'>$hou $as</td>"; $tablahtml.="</table>";
El punto es que necesito que en la columna cantidad me salga el valor del array $cant segun corresponda, lo hice con print_r y no funciono, poniendo $cant y tampoco.
Alguna idea de como lograrlo?