Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/06/2010, 11:42
FreddOc
 
Fecha de Ingreso: mayo-2010
Mensajes: 7
Antigüedad: 13 años, 11 meses
Puntos: 0
[Ayuda] Guardar los datos de un formulario en un '.txt'

Primero que nada, me presento, soy nuevo en el foro y pues quisiera saber si alguien me podria ayudar con este script, basicamente se trata de guardar los datos introducidos en el formulario en un archivo '.txt' aqui tengo algunas indicaciones y parte del script que tengo si alguien me pudiera ayudar se los agradecere eternamente :D
______________________________________________
Hacer un script en PHP que guarde los datos de un
formulario en un archivo '.txt'

La escritura de archivo es un registro por cada vez
que se envien los datos.

Los datos se agregan al archivo cada que se envia
la información en el script.
______________________________________________

Código:
<!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>Formulario</title>
<style type="text/css">
</style>
</head>

<body bgcolor="#FFFFFF">
<FORM method="post" name="formulario">
Nombre:<input type="text" name="nombre" id="nombre">
<br />
Apellido: <input type="text" name="apellido" id="apellido">
<br />
Carrera: <input type="text" name="carrera" id="carrera">
<br />
Materia: <input type="text" name="materia" id="materia">
<br />
<input type="submit" value="Enviar">
<input type="reset">
<?php
$archivo = "alumnos.txt";//creamos un archivo llamado 'alumnos'
$gestor = @fopen("alumnos.txt", "w");//abrimos este archivo

fclose($gestor);//cerramos el archivo de alumnos
?>
</FORM>
</body>
</html>
MIL GRACIAS DE ANTEMANO :)