Hey,
Well, probably the most simple solution would be to write to a text file, and you can get information on that at
www.php.net. But, your best option would be using a mySql database because of its flexibility, security, and speed. Your best bet here would be to read a tutorial to get yourself started. You may want to try this one:
http://hotwired.lycos.com/webmonkey/99/21/index2a.html
Either way, yes you need to write this information to some sort of file, be it a flat file (text) or a database.
Good luck, and dont hesitate to ask questions here as you move along!
-Scott-