Hi, anyone can tell me the way to display how many users are online the site in PHP without utilizing mysql ??? Thank you friend
You'll need some sort of counting system so you either use a text file as a database table or you use mysql. effectively everytime someone opens a page you read the contents of the file, drop the lines that are "old" and add your new line and write to the file. The line might be datetime|ip address that way you know when the line is "old" and you know who accessed. Also gives you the option to remove old lines for the same IP so that 1 person with 5 tabs open only gets counted once.
Start a session at the beginning of every page then use session_save_path() to see where the sessions are saved on the server and read all the access times of the files in that directory (they begin with 'sess'). Count all the files that have been accessed within the past 2 to 5 minutes.... this count will be how many users are currently browsing your site.
My friend created a tutorial for who is online. check it out http://notan00b.com/tutorials/whosonline-tutorial/
I would utilize some PHP and Javascript. do a onload() and onbeforeunload() that sends data to php to save to file or db. That is how Google does it on their analytics system.
I just created a flash version to check its pretty active.. down the the last minute of when a user was online. Anyways its also a chatroom
This is a neat trick anyway, any ideas when we implements dynamic sessions, i.e "session_regenerate_id" does the file name stays the same? thank you for your time