You mean a text file, right?
Well assuming your form uses POST as its method, you could use:
<?php
$fp = fopen ("datafile.txt", "a");
foreach ($_POST as $key => $value) {
fwrite ($fp, "$key = $value\n");
}
fclose ($fp);
?>
That should get you started 🙂