You need to store information on your server, so you need to use either a file that you update for each pageload; In a table you can store the IP addresses of computers that are requesting your pages, and use some function to decide whether a person is online e.g., a 20 sec timeout. You cannot reliably tell whether a person is still on a certail page.