simonp Posted October 25, 2008 Share Posted October 25, 2008 Hi folks, I have some code that checks if a server is online. I want the code to check continually (ie every 1 second) - I know I could use a meta refresh but that's a bit clunky. Is there a way I can setup a loop around the code that would do it more cleanly that meta refresh? Hope this makes sense and someone can help! Cheers Simon Link to comment https://forums.phpfreaks.com/topic/130101-refresh-or-loop-question/ Share on other sites More sharing options...
dezkit Posted October 25, 2008 Share Posted October 25, 2008 AJAX Link to comment https://forums.phpfreaks.com/topic/130101-refresh-or-loop-question/#findComment-674572 Share on other sites More sharing options...
simonp Posted October 25, 2008 Author Share Posted October 25, 2008 Thanks - but that really doesn't help much! Can you expand? Link to comment https://forums.phpfreaks.com/topic/130101-refresh-or-loop-question/#findComment-674606 Share on other sites More sharing options...
dezkit Posted October 25, 2008 Share Posted October 25, 2008 See the post magnificent post below Link to comment https://forums.phpfreaks.com/topic/130101-refresh-or-loop-question/#findComment-674609 Share on other sites More sharing options...
genericnumber1 Posted October 25, 2008 Share Posted October 25, 2008 Nah, AJAX isn't a scripting language it's a programming technique... that said: You could use AJAX good sir! It is "a way of including content in a web page in which javascript code in the web page fetches some data from a server and displays it without re-fetching the entire page at the same time, hence the term 'Asynchronous'." It's really hard to elaborate other than to tell you to use AJAX because it would be a lot of code to write. Google some tutorials on AJAX techniques. You'd just use javascript to retrieve the server statuses from a separate php script and then update the page the user is viewing with the result of the request. Link to comment https://forums.phpfreaks.com/topic/130101-refresh-or-loop-question/#findComment-674611 Share on other sites More sharing options...
simonp Posted October 25, 2008 Author Share Posted October 25, 2008 ok - thanks guys - i'll do some googling. cheers simon Link to comment https://forums.phpfreaks.com/topic/130101-refresh-or-loop-question/#findComment-674614 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.