I am writing a script that will take form data and save it to a text file. now... I want the newly submitted data to be added to the first line of the text file instead of the last line. How can I do this? I have tried $handle = fopen("headlines.txt", "r+"); but this erases all the text in the file and writes the new text.