Click here to load reader
Upload
lupithaa-guerrero
View
201
Download
1
Embed Size (px)
Citation preview
UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECAS UNIDAD ACADÉMICA DE PINOS
TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN
DESARROLLO DE APLICACIONES II
A1U2GA
Guadalupe del Rosario López Guerrero
Mario Alejandro Sánchez Pérez
Grado: 4° Grupo: A
ITIC. Eloy Contreras de Lira
Fecha de entrega : 09/10/2013
UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECAS UNIDAD ACADÉMICA DE PINOS
TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN
Este es el codigo donde esta el formulario y el primer documento con PHP
<!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>
</head>
<body>
<form id="form1" name="form1" method="post" action="escritura.php">
<table width="324" border="1">
<tr>
<td width="84">NOMBRE</td>
<td width="224"><label for="nombre"></label>
<input type="text" name="nombre" id="nombre" /></td>
</tr>
<tr>
<td>APELLIDOS</td>
<td><label for="apellido"></label>
<input type="text" name="apellido" id="apellido" /></td>
</tr>
<tr>
<td>EDAD</td>
<td><label for="edad"></label>
UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECAS UNIDAD ACADÉMICA DE PINOS
TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN
<input type="text" name="edad" id="edad" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="button" id="button" value="Guardar" /></td>
</tr>
</table>
</form>
<?php
$fp=fopen("archivo.txt","r");
while(!feof($fp)){
echo fgets($fp)."<br/>";
}
fclose($fp);
?>
</body>
</html>
UNIVERSIDAD TECNONOLÓGICA DEL ESTADO DE ZACATECAS UNIDAD ACADÉMICA DE PINOS
TECNOLOGÍAS DE LA INFORMACIÓN Y COMUNICACIÓN
CODIGO FUENTE DE ESCRITURA
<?php
$nombre=$_POST['nombre'];
$apellido=$_POST['apellido'];
$edad=$_POST['edad'];
$linea=$nombre."\t".$apellido."\t".$edad."\n";
$fp=fopen("archivo.txt","a");
fputs($fp,$linea);
fclose($fp);
?>