I'm trying to make a little and simple chat system on PhP.
My Idea was simple really, I have a form that send a text to a script in PHP and that script save the var in a Database, then the other user refresh the page to download the new message and display it on the chat box.
The problem comes, when I say refresh the page.
I just think that probably would be a problem for the user refresh the entire page every second or less thank's to a JavaScript function.
The original idea was to use setInterval() but know I'm thinking that this can be a bad idea.
I'm not sure, but from chrome when you refresh a form it will save the form and fill it automatically, once you have finished the refresh, does every browser do that?
Willa a JavaScript function for refreshing the page be a problem for who have a really slow connection?
But most important, to fix the problem, is actually possible to just refresh a specific PHP script, that allow the user to refresh only that script and download the new message, without refreshing the entire page every second?
All the help would be appreciated.
-NOTE-
To be honest, the guy that want me to do that chat system asked me to not use JavaScript, so theoretically I'm not even allowed to use setInterval()