I have made a php chat webpage with some javascript. I don't use a database to store the messages. Instead I use a text file.
I am trying to make the page to refrseh automaticaly when a new message is sent from a user. So I made an interval of 3 secs for the page and every 3 secs I am using the filesize(chat.txt) to check if the size of the file has changed (so I can refresh the page to show the new messages). The problem is that the filesize command always returns the same file size even if someone has send a new message. the filesize is corect only when I refresh the page.
Thank you in advance!