Hello.
I have a onlineusers.txt <b>text file</b> that keeps track of all the users online.
The file looks like this:
< snip >
username1
username2
username3
username4
< snip >
I want a php page called logout.php and removes a user when the person types in their username into the query string or php page which I can do myself, eg.
logout.php?user=USER_NAME
I want the script to search the .txt file for that username and remove it from the list and then rebuild the text file if needed with the same name. SO i'm thinking of using a .tmp (temp file) to temporarly store the list.
Can someone give me the php source code to do this. I know it ain't efficient but I need it done this way. Thank you.
I don't want to use mysql or any other database type file, just a simple text file.
So if username3 logs out, the file should then rebuild itself to look like this..
< snip >
username1
username2
username4
< snip >