The script basically works like this. It receives server information and gets the time. In MySQL it fills in the values of the person online and puts up a message if it fails. After a timeout period MySQL deletes the user i.e. we assume that the user is not on our site anymore.