I'm a newb, so there may be an obvious answer to this question, but I can't seem to find it.
I am storing records in a text file that were submitted via a form in HTML. Each user has their own text file containing their data. I want to grab the first two records from a text file, then delete everything within the text file (only 1 line) and re-write the line with the new information. In essence, I am tyring to update the text file with the user's new information and the easiest way that I could think of would be to just rewrite the file (it is a small number of variables). I can use fopen("file.txt","w") to open the file and delete all contents, but I want to read the first two records from the file first (in order to check username and password combination) and then delete the contents. Any help would be GREATLY appreciated. Thanks!