Allright, I'm a rookie coder, so ignore me if anything I say is blindingly stupid...
Is it possible to have PHP sessions without databases? is unsure
I'd like to stick a "users online" feature on my site, but have no idea even how to begin doing something like this.
I had theorised I could use files, but then I come to the problem that although I know how to write a script to add names to a "user online" file, I didn't know how to best write a script which would detect that the user is nolonger on, and remove them.
I suppose I could offer a "logout" script which would remove them from the users online, but then most people are lazy and won't click the logout, they'll.
I had thought that every time a user hits a page, the "users online" file could be truncated and the user hitting the page would be added again - the only problem with this is that only one name would ever be on the list.
It's 1am, I've had a long day, maybe I'm just tired and am missing the obvious solution...
Anyone know a place with sample code I can learn from maybe?
It's how I've learnt PHP So far. Good ol' trial an' error. ¦:¬)