Pues si lo que quieres es escribir datos en un .txt, puedes hacer esto:
<?php
if (isset($_POST['submit'])) { // Veo si ya apretaron boton Enviar...
$mensaje = $_POST['nombre'] . "\n"; // Pongo contenido variable NOMBRE en MENSAJE
$mensaje .= $_POST['apellido'] . "\n"; // Pongo contenido variable APELLIDO en MENSAJE
$fp = fopen("myarchivo.txt","w"); // Acá se abre el archivo "myarchivo.txt" con permisos de escritura.
fwrite($fp, $mensaje); // Escribo el contenido de la variable $mensaje al archivo.
fclose($fp); // Cierro el archivo.
exit; // Salgo
}
?>
<form action="" method="post">
<input type="text" name="nombre">
<input type="text" name="apellido">
<input type="submit" name="submit">
</form>
Puedes usar ese código que acabo de hacer pero cambiando los campos por los tuyos y listo...