Quote:
|
Originally Posted by Richard M
It won't if you use the fopen flag "a" which opens the files then appends the info to what is already there.
|
But that doesn't take into account changes in the middle, such as editing and deleting links.
The best way around it still using a simple flat text file is to give users the option, to add or edit links. If they want to add, fine just open as normal and append. If they want to edit/delete a link, then you need to give the user exclusive access by locking the file. PHP can do this with flock. If it didn't or isn't supported, you could just temporarily rename the file, so the second person attempting to gain access would an "in use" message when PHP does the "file_exists" bit.