on a multiuser system there isn't an easy way to secure text files writable by the web server.
if you're using apache with default user.group of nobody.nobody you could have the server create the text files and assign permissions (chmod) so only the owner can read write. now only processes running as nobody.nobody and read and write to the file. upside is that this will slow most users. downside is that you can't easily see the file except using the web interface and that anyone else on the server with cgi/php access can create a script to access your file.
if the file is owned by you then global read & write permissions would need to be set. this means that anyone else on the system could read and edit the file.
in most cases a database is perferred for easy of use & security.