Desarrollo de aplicaciones_ii
-
Upload
berenice-ceja -
Category
Technology
-
view
23 -
download
0
Transcript of Desarrollo de aplicaciones_ii
UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECASUNIDAD 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 : Adriana Berenice Renovato Ceja
Rocío Marbelín Zapata Palomo
Grado: 4 Grupo: “B”
TSU en I. Eloy Contreras de Lira
Fecha de entrega 09/10/2013
UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECASUNIDAD ACADÉMICA DE PINOS
TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN
MANEJO DE ARCHIVOS
Interfaz de 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=utf-8" /><title>Untitled Document</title><style type="text/css">#form1 h1 #button {
color: #FF0080;}#form1 h1 #button {
font-family: Verdana, Geneva, sans-serif;}#form1 h1 #button {
font-family: Georgia, Times New Roman, Times, serif;}#form1 p #textarea2 {
font-family: Courier New, Courier, monospace;}#form1 p #textarea2 {
color: #008000;}#form1 p #textarea2 {
color: #0000A0;}</style></head><body><form id="form1" name="form1" method="post" action="escribir_archivo.php"> <p> <label for="textarea2"></label> <label for="textarea"></label> <img src="imagenes/7254737-chico-de-dibujos-animados-trabajando-con-el-equipo-ilustraci-n-vectorial.jpg" width="216" height="178" /><img src="imagenes/gif.gif" width="75" height="75" /></p> <p align="left"> <textarea name="textarea" id="textarea2" cols="45" rows="5"></textarea> </p> <h1 align="left"> <input type="submit" name="button" id="button" value="Escribir" /> </h1></form></body></html>
UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECASUNIDAD 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, "\r\n");
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);
?>