>>and you can see this update in real time
browsers "PULL" information FROM servers. Servers do NOT "PUSH" information to "browsers". So, on the back end (Server) you can use php, asp, perl, jsp - or whatever you have available at your disposal. The point is that for your needs you need to periodically "PULL" data from the server. Refer to the following Ajax tutorial.
http://www.w3schools.com/A
Once you've read through the basics, be sure to read the "Advanced" section since it has useful examples.
Main Topics
Browse All Topics





by: b0lsc0ttPosted on 2009-11-03 at 09:28:15ID: 25731307
Do you need this to be part of a web page or just a web page that shows the info? Are you asking how to show it or how to keep track of it?
ic-asp-and -ajax-tuto rial/. There is also a good explanation on what AJAX is at http://en.wikipedia.org/wi ki/Ajax_%2 8programmi ng%29. The reference site W3Schools has a good section on AJAX at http://www.w3schools.com/a jax/defaul t.asp.
A field in the DB could keep track of it. Every time they click then you increment that field by one.
If it is just a page then use the meta refresh tag in html to have the page reload at regular intervals (i.e. 30 seconds, 90 seconds, etc). No reason to use AJAX or something fancy. You can't really do it real time since there is no way for the server to "push" the updated info but this method would definitely keep it really close to real time.
If it is part of a page then you would want to look at AJAX. Do you already know how to provide it? If not then one of the best explanations and simplest examples I have found on the net is at http://skeymedia.com/class
The example in that first link will provide a good guide for what you want. If you want another example that uses it a couple of times then let me know (i.e. choose one AJAX fills second, make another choice for second and AJAX fills third). The first example should be enough. After that it is ASP (or server script, in your case PHP), Javascript, and page stuff.
AJAX is more work so I would only use it if you have to put this info in part of a bigger page. Then you can use it to dynamically update that part of the page without refreshing the whole page. You would need to use Javascript and setInterval to create a way to have the AJAX process "run" every minute or so.
If you need help using it then please provide what you have so far. Let me know how this helps.
bol