Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/09/2008, 10:35
Avatar de Quclii
Quclii
 
Fecha de Ingreso: julio-2008
Ubicación: Guadalajara
Mensajes: 76
Antigüedad: 15 años, 9 meses
Puntos: 0
Pregunta Como le hago ?

Código:
<HTML>
<style type="text/css">
<!--
.Estilo1 {
	font-family: "Lucida Console";
	font-size: 12px;
}
.Estilo2 {font-size: 12px}
.Estilo3 {font-family: "Lucida Console"}
-->
</style>

   <Script>

        function Valid (){
                           var x = event.keyCode
                           status=x
								
                           if( x > 48 && x < 57 || x == 32 ){
                                                              return true; 
                                                            }
                           return false;
                         }

       function Documento(){
                             document.form1.datos.value = document.form1.datos.value + ' ';
     
                      }
   </Script>

   <Body>


       <form name="form1" method="post" action="Crear.php">

             <p class="Estilo2"><span class="Estilo3">Nombre Archivo:</span> 
               <input type="text" name="archivo">
         </p>
             <p><span class="Estilo1">Ingresar Numeros Enteros :</span> 
               <textarea name="datos" cols="30" onKeyup="Documento()" onKeyPress="return Valid()"></textarea>
           </p>
             <p> 
               <input name="submit" type="submit" value="Guardar">
             </p>
       </form>

       <form method="post" action="Leer.php">
           
             <p>
               <input type="text" name="abrir">
               <input type="submit" value="Abrir">
             </p>
             <p>
               <input name="forma" type="radio" value="lectura" checked>
               <span class="Estilo1">LECTURA
               <input name="forma" type="radio" value="modific"> 
                MODIFICAR         </span></p>
       </Form>
       
   </Body>

</Html>

Esta parte del codigo crea el archivo
Código:
<Html>
<style type="text/css">
<!--
.Estilo1 {
	font-family: "Lucida Console";
	font-size: 12px;
}
-->
</style>

   <Body>

      <?php

          $archivo=$_POST["archivo"];
          $datos=$_POST["datos"];
          $ingreso = file_put_contents($archivo,$datos);

      ?>

      <span class="Estilo1">Archivo Creado</span> <a href="Inicio.Html" class="Estilo1">REGRESAR</a>

   </Body>

</Html>
Aqui el problema esta es laa parde donde lee el archivo
como puedo hacerle para que se importe el archivo ya creado
a textarea para poder modificar el archivo
Código:
<Html>

  <Body>

     <?php

        $abrir=$_POST["abrir"];
        $forma=$_POST["forma"];

        if($forma==lectura){
                              $datos = file_get_contents($abrir);
	                          $datos = explode(' ',$datos);
	                          foreach($datos as $elemento){
	                                                        print(" ");
	                                                        print($elemento);
                                                          
                            }
        else{
	          $datos = file_get_contents($abrir);
	          $datos = explode(' ',$datos);
	          foreach($datos as $elemento){
                          aqui bueno segunyo tengo que poner el codigo para ke lo mande a el textarea que se llama datos
                                          }
            }

     ?>

  </Body>

</Html>
porfas ayudunme komo le puedo hacer

Última edición por Quclii; 09/09/2008 a las 11:43