php - Checking for server availability -


trying take address database , written in array, says bad, servers available.

include('config.php'); $query_select = "select `ip` `server`"; $result_select = mysql_query($query_select); $host=array(); while($row = mysql_fetch_array($result_select,mysql_assoc)) {     foreach ($row $r){        $host[$r] = $r;      } } foreach ($host $h){     $waittimeoutinseconds = 1;          if($fp = fsockopen($h,$waittimeoutinseconds)){                  echo 'good';         } else {               echo 'bad';                  }  fclose($fp); } 


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -