well you can do it, by connecting it to a DB or a text file where the previous contents of the file data will be overwritten.in my opinion it is better to go with Database.
normally some people would prefer require for security purpose, as the above page does not load ( ie .php file ) the entire page should view as error document.