Jump to content

refresh or 'loop' question?


simonp

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.