Online Users- Text File<

liunx

Guest
okay, i want a VERY simple that script that displays how many people are on (using a text file, not MySQL).

i had thought about using my counter script and adding counter-- when the user leaves the page, but how do you track when they leave the page?!

or should i just Download a script?You have to time users out (remove their ID from your little list) after, say, 10 minutes.

So, you keep a list of all people that clicked something on the site only in the last 10 minutes, and count that.


You can never see when users actually went away, or where they went.is there a way to link javascript and PHP, because im prety sure theres a way to do it in Javascript, i've seen *ugh* popup ads do it beforeWell, there's a key difference to how Javascript and PHP are parsed. PHP is parsed on the server before the page is sent to the client's browser. Javascript is run in the client's browser (not on the server). What this means is that you can pass the output of PHP to be used in some javascript, but javascript cannot affect the PHP output.

For what you are looking to do you really do need a database. You could just about implement it with flat files but it would certainly not be a "very simple" script, nor would it be efficient. If you had a lot of concurrent visitors you would suffer poor performance
 
Back
Top