I have a .php file, and i would like only one part to reload as often as possible (i hvae a online visitors counter that needs constant updates) how can i do this?
The easiest way is to have the part you want to refresh in an IFRAME with the meta refresh on the target document/page set to 1 second.
Create a small flash movie for your stat counter that is 30 seconds long and have it loadvars from a php file on your server. Its more seemloess and prettier then an IFRAME. Mike
Yes, I agree with Shawn -- iframes or you can update some variables with JavaScript. I also use quite a bit of Java [Applets] to achieve the dynamic page [area] refreshing that you speak of. See the WiredPages link, below for some examples. PHP example -- I give the impression I am refreshing data using a PHP function inside an iframe. See this post as an example -- GEO Coder. Q...
With JavaScript look into the onchange function associated with a form field. A good JavaScript reference book will show how it works. Q...
Hi, You can use AJAX: make a PHP file that simply outputs the visitor count and nothing more, and request that in your JS by using the XMLHttpRequest object. If you want it to update on the user's pages as soon as the visitor count increases, in effect making a live counter, there are ways of simulating a persistent connection, but they can get quite tricky. - P
Yes, AJAX is pretty impressive. However, right now the number of browsers supported is limited. See some of the AJAX demos offered here -- Open Rico. Make sure you have a browser that supports. [Latest release of Firefox]. Q...
The technology itself is relatively old. AJAX is just a new usage of it. I believe it's supported in all major browsers. - P