Este documento describe el manejo de archivos en PHP. Presenta un formulario HTML para escribir un mensaje en un archivo de texto llamado "archivo.txt". Luego, usa funciones PHP como fopen, fputs, fwrite y fclose para agregar el texto ingresado por el usuario al archivo. Finalmente, otro script PHP llamado "leer_archivo.php" abre y lee el archivo línea por línea para mostrar su contenido al usuario.
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
A1 u2gb manejo de archivos
1. UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECAS
UNIDAD ACADÉMICA DE PINOS
TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN
Materia
DESARROLLO DE APLICACIONES II
Tema
MANEJO DE ARCHIVOS
Nombre completo del Alumno : Azucena Pérez Gallegos
Daniel Torres Salas
Grado: 4 Grupo: “B”
Nombre del Docente : Eloy Contreras
Fecha de entrega : 09/10/2013
2. UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECAS
UNIDAD ACADÉMICA DE PINOS
TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN
escribir_formulario.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="escribir_archivo.php">
<p>
<label></label>
</p>
<p> "MANEJO DE ARCHIVOS"<br />
<input type="image" name="imageField" src="archivos.jpg" />
</p>
<p>Hooooola!! teacher Eloy<br />
<label></label>
<p>espero que se encuentre muy bien...<br />
<textarea name="textarea"></textarea>
</p>
<p>
<label></label>
<input type="submit" name="Submit" value="Write" />
</p>
<p>
<label></label>
</p>
</form>
</body>
</html
3. UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECAS
UNIDAD ACADÉMICA DE PINOS
TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN
escribir_archivo.php
<?php
$text=$_REQUEST['textarea'];
$fp=fopen("archivo.txt","a");
fputs($fp,$text);
$fp=fopen("archivo.txt","a");
fwrite($fp, "rn");
fclose($fp);
?>
<script>
location.href="leer_archivo.php";
</script>
leer_archivo.php
<?php
$fp=fopen("archivo.txt","r");
while(!feof($fp)){
$linea=fgets($fp);
echo "$linea <br/>";
}
fclose($fp);
?>