Ewww, plain text files. I take it you don't have a database? If you did, all you'd do is a. create a new text file (fopen), b. give it a name based on the user's $firstname$lastname (or whatever) (tmpnam), c. save it to your directory (find any upload script), and then d. assign it to a field in a database (update sql statement).
If you don't have a database... well, I have no idea.
In any case, the functions you should look at are:
fopen (w+ or a+)
fwrite
tmpnam
fread (to read the file; though you can probably just require_once ("file.txt); into your user's page, unless you're going to allow editing)