Script not working correctly

From: Date: Mon, 17 Jun 2002 17:25:45 +0000
Subject: Script not working correctly
Groups: php.windows 
Request: Send a blank email to php-windows+get-14242@lists.php.net to get a copy of this message
I created this script to ping a host and if a response is not received then insert into a second table and ping it after x amount of minutes. The script seems to work fine until it starts to ping the hosts in the second table then it goes to page cant be displayed. I need to script to entire script to run constantly but with a delay before it runs. Please help. <?php sleep(300); mysql_connect("localhost"); $bquery = "delete from josh.down_sites where id!=0"; $bresult = mysql_query($bquery); mysql_connect("localhost"); $query = "SELECT * FROM josh.temp order by id"; $result = mysql_query($query); while($myrow=MySQL_fetch_array($result)) { $site=$myrow["site"]; $ping = ping -n 10 $site; if (eregi("request", $ping)) { $time = date("H:i:s"); $aquery = "insert into josh.down_sites values('','$site','$time')"; $aresult = mysql_query($aquery); } } sleep(150); $cquery = "SELECT * FROM josh.down_sites order by id"; $cresult = mysql_query($cquery); while($myrow=MySQL_fetch_array($cresult)) { $site=$myrow["site"]; $ping = ping -n 10 $site; if (eregi("request", $ping)) { $time = date("H:i:s"); mail("jevans@acs.roadway.com","$site","This is a e-notice from HD_Service_Scan that as of $time $site is currently down or experiencing performance problems."); } } ?> Josh Evans ACS Helpdesk Programmer jevans@acs.roadway.com

« previous php.windows (#14242) next »