Hey,
I know this sounds daft but I've just started using PHP Arrays & Im not familiar with them.
Ive looked on the PHP website & got abit of help & got my script to work.
Basically, I've made a script for work so that when one of our customer's servers is down, it will email us, it all works perfect apart from the array's are outputted twice which means it will send me 2 emails rather than 1...
Here's what I got..
Can someone help me and point me in the right direction?PHP Code:
$siteToMonitor = array("mail.**.co.uk", "mail.**.co.uk"); // Accessable mail. url's
$siteToMonitorNames = array("** Server", "** Server"); // Name of the server's
$count = count($siteToMonitor);
$count2 = count($siteToMonitorNames);
for($a = 0; $a < $count; $a++){
for($b = 0; $b < $count2; $b++){
if (isDomainAvailible("http://" . $siteToMonitor[$a])){
echo "<strong>" . $siteToMonitorNames[$b] . "<span style=\"color: green\">Active</span> - <a href=\"http://" . $siteToMonitor[$a] . "\" target=\"_blank\">http://" . $siteToMonitor[$a] . "</a></strong><br />";
}else{
//echo "<strong><span style=\"color: red\">Inaccessible</span> - <a href=\"http://{$value}\" target=\"_blank\">http://{$value}</a></strong><br />";
}
}
}
+REP, Lew.