Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/02/2008, 17:30
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 20 años, 5 meses
Puntos: 2135
Re: Campos de Texto en PHP

Lo mejor es así:
Código PHP:
<?
$cont 
= 1; 
while(
$cont <= $ncampos) {
?>
Datos de la new: <input name="new[<? echo $cont ?>]" type="text" size="5">
                 <input name="nombre[<? echo $cont ?>]" type="text" size="5">
                 <input name="direccion[<? echo $cont ?>]" type="text" size="5">
<br>//este y otros es el que yo kiero agregar
<?
$cont
++;
}
?>
Luego en PHP:
Código PHP:
<?php

$num_de_news 
= 0; 
if ( 
is_array ( $_POST['new']) ) 
{ 
for( 
$i = 0; $i < $_POST['total']; $i++ ) {
         
$new = $_POST['new'][$i];
         
$nombre = $_POST['nombre'][$i];
         
$direccion = $_POST['direccion'][$i];
         
$num_de_news++;
} 
?>
Saludos.

PD. Por favor no revivas temas viejos, siempre es mejor empezar uno nuevo con referencia al anterior.