Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/08/2005, 13:28
Avatar de claudiovega
claudiovega
 
Fecha de Ingreso: octubre-2003
Ubicación: Puerto Montt
Mensajes: 3.667
Antigüedad: 20 años, 6 meses
Puntos: 11
Prueba esto:

Código PHP:
<?
$archivo 
fopen('archivo.txt','r');
$lineas count($archivo);

?>
<html>
<head>
<script type="text/javascript">
    num=<?php echo $lineas;?>;
    function anadir(){
        num++;
        elem=document.createElement('input');
        elem.type='text';
        elem.name="'.$num'";
        document.noticias.appendChild(elem);

    }

</script>

</head>
<input type="button" value="Nueva linea" onclick="anadir();">
<form name="noticias" method="get" action="procesa.php">
<?
$id
=0;
while(!
FEOF($archivo)){

    
$buffer=fgets($archivo1024);
    if(
$buffer!=="\n"){
    echo 
"<input type='text' value='$buffer' name='$id'><br>\n";
    
$id++;
    }
}

?>
<input type="submit" value="Guardar noticias">
</form>