May 19, 2010

How to run my php code in every X minute?

Question by Holian

i try to make a “status monitor” for our small network. After the page was load i make a ping for every IP which i addedd. Its, ok. But i would like to do this ping in every X minute, without reload my hole page.

I can make it if i reload the page with header refresh, but i would like to do this witout reload.

I think i have to do this with AJAX?, But i dont know how..

Thank you

Answer by Dan McGrath

I’m not sure exactly what you want to do here, but this quick tutorial shows you how to call a php file every second and update a dib block with the results. It is quick and simple using jquery.

Answer by Starx

If it is entire code of page i suggest setting up a cron job

and if you want to use ajax ( ie jquery ajax there is a plugin called jquery timer) use it send a ajax request to the page with code you want to run.

http://plugins.jquery.com/project/timers
check this out

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!