Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/11/2011, 09:59
nasl86
 
Fecha de Ingreso: mayo-2011
Mensajes: 22
Antigüedad: 13 años
Puntos: 0
Pregunta Insertar datos en un Arreglo desde un formulario

Buenas amigos tengo un problema necesito insertar datos que envio desde un formulario y luego mostrar todos los datos insertados!!...
he hecho algo pero lo que me hace es reemplazar los datos anteriores..


AQUI EL CODIGO A VER SI ME PUEDEN AYUDAR!!

<body>

<form name="form1" action="" method="post">

Nombre:
<input type="text" name="nomb" /><br /><br />
Cedula:
<input type="text" name="ci" /><br />

<input type="submit" name="enviar" value="Insertar" />


</form>

<?php

if(isset($_POST['enviar'])){

if ((isset($_POST['nomb'])!=empty($_POST['nomb'])) && (isset($_POST['ci'])!= empty($_POST['ci'])) ){


$n=$_POST['nomb'];
$c=$_POST['ci'];





$a[]=$n;
$b[]=$c;

$p= count($a);
$p2= count($b);


for ($i=0; $i<=$p; $i++){

echo $a[$i];

echo $b[$i];




}

}
}
?>


</body>
</html>