View Full Version : How do I make a fwrite function place a message before the existing text?.....

Silver Sun
02-02-2003, 12:03 AM
......How can i have a block of text sent from a form be placed at the top of a text file?

currently using a+, r+ replaces all existing, i need the existing text to remain, and the new text to appear at the top.

02-02-2003, 01:11 PM

You need to read the existing data. Store it in a variable. For eg $existing.

then when you write, write $new$existing...

So that the new is at the top of the file. I don't think there is a function for entering new data without deleting the old. But I think this method serves the purpose.