On 09/11/2004, at 2:33 PM, Michael Gale wrote:
I am working on a site where people will be updating information in a database and should have up to date info. Now since HTTP is stateless the user will not know about any new information until they click on a link or hit a button on the page.
My question is -- if I want to keep a user up to date about changes to any information they might want to know would it be best to create a hidden frame of some sort which does a mete-refresh to a page looking for updates, and if found display a java popup window with a small FYI ?
Refreshes can be done with header() in PHP, and with <meta>.
There's also JpSpan (XmlHttpRequest), which means that a javascript (be you're aware that some users may not have it enabled) can query the server to retrieve information and act on it.
http://jpspan.sourceforge.net/wiki/doku.php?id=javascript:xmlhttprequest
If so would a meta-refresh of 3-5 seconds be to aggressive ? What about server load ?
If you want to ask the server for new data every 3 seconds, it doesn't matter which way you do it, the server will have to respond with something. The answer to server load is to buy more hardware, and optimise the ___k out of your code, mark-up, and queries :)
Justin French
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php