I have a difficult problem. To simplify the situation, I have a few files (written in perl) that move around a bit and do random stuff. *These files constantly run and update themselves.
I would like to code a web interface to view and manage these files.
The problem I'm having is how to get the page to constantly monitor their position and actions.
Now I could just use AJAX (which I'm not familiar) to check every minute or so for updates, but I'd rather the page update itself or something update the page whenever "something happens."
To again simplify:
automated file moves/updates -> webpage updates to show change
I'm willing to use most any (free) technology to get this done.
-- I've looked at Ruby on Rails because I'd heard Mongrel can do something like this, but I can't seem to find any documentation on it.
-- Can AJAX constantly check a page?
-- I remember a chat program written entirely in php once that worked by the page constantly loading. I'd rather not have the loading bar run like mad, but I'll take what I can get. I believe it might have had something to do with ob_start/ob_flush, but I really don't remember. Is this a possible solution?
-- Or--and I almost hate to ask--would Flash be a viable solution?
Thanks
Send data to page(browser) after page load (or during)
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Re: Send data to page(browser) after page load (or during)
AJAX can check the server for changes. In fact, that's what it's designed to do. There really is no way to have the server "contact" the client--basically unheard of in the web world. If you did it in Flash, you'd still be using asynchronous requests, just not Javascript and (probably) not XML. 
Re: Send data to page(browser) after page load (or during)
You could ping with AJAX every second or so and update if necessary. Another thing that comes to mind is php sockets. And lastly, an infinite loop that checks for stuff.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: Send data to page(browser) after page load (or during)
Alright. Well, maybe a better solution will come along, but for now I guess I'll see how close I can get with AJAX.
php sockets is confusing the hell out of me. At least in terms of this problem. Never worked with it before.
Thanks for the help.
php sockets is confusing the hell out of me. At least in terms of this problem. Never worked with it before.
Thanks for the help.