First, I would very highly suggest that you use a database like MySQL for storing things.. its much faster than flat text files, and in the future will make life much easier.
As far as registration numbers, there's a few ways to do it... usually I used an auto_increment column in a MySQL DB to do this. You could do something like MD5 the current date/time.
To stop multiple submits, store the users IP address (again, I would use a DB) and set an expiry time (2 minutes or so). Then when they try to do a submit, check for that IP and if the expiry time has passed.
What have you
http://www.foundonp2p.com