Hi Guys, I have recently developed a chat room created in Flash and PHP. What i would like to know is how can i delete the user from the flat file when he/she logs out by pressing a button?
Cheers, Michael
Ouch, flat file. Why not a database?
a) read the file in b) write a copy out to a temporary file (leaving out the bit you want deleted) c) delete the file d) rename the temporary file to the original filename.
Get a database. It'll make you life a whole lot easier.
Just to add to the earlier reply, you can use something like str_replace, or ereg_replace to delete the user you want to remove. Just replace user with an empty string.
http://geocities.com/akindele/