View Single Post
Old 10-08-2005, 10:28   #9
punky
Inactive
 
Join Date: Jun 2003
Age: 45
Posts: 14,750
punky has a golden aurapunky has a golden aura
punky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aura
Re: HTML Code Question

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.
punky is offline   Reply With Quote