Hello.
I have a onlineusers.txt text file 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 logs a user out 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.