I made a simple code you may use to inspire yourself :
<?PHP
if (!$first) {
echo "<form action='form.php' method='post'>";
echo "First name : <input type='text' name='first'>
";
echo "Last name : <input type='text' name='last'>
";
echo "Phone : <input type='text' name='phone'>
";
echo "<input type='submit'>";
} else {
$file = fopen("$first.txt", "a");
fputs($file, $first." - ".$last." - ".$phone);
echo "Thanks dude";
}
?>
Don't put the txt files in the same folder of your web server because someone who wants them might access them very easily. Just change everything you need up there, was just showing how to do it.
* Forgot to explain what the script was doing, for those who didn't know. It creates a .txt with the first name you entered. For example, if you entered John as your first name, it'll create John.txt with all the informations you need in it :
First Name - Last Name - Phone Number