מה שאני מנסה לעשות שיופיע לי רקע שונה כל פעם לדוגמא:
hosts.co.il -תפוס ( רקע אפור )
hosts.org.il -פנוי ( רקע לבן )
hosts.com-פנוי ( רקע אפור )
hosts.org -פנוי ( רקע לבן )
*לצבע אין שום קשר לתוצאה אלה לסדר שהתוצאות מוצגות.
קוד נכון לעכשיו
PHP קוד:
function showDomainResult($domain,$server,$findText){
global $i,$count,$errors;
$i = 0;
$count = 0;
$errors = 0;
if ($count == 0){
$color = "#e2e2e2";
$count = 1;
}else{
$color = "#ffffff";
$count = 0;
}
if (checkDomain($domain,$server,$findText)){
$i++;
$errors++;
echo '<tr bgcolor="'.$color.'"><td bgcolor="white"><input type="checkbox" name="d'.$i.'" /><td><div style="direction:ltr;">'.$domain.'</div></td><td style="color:green;">פנוי</td></tr>';
}else{
echo '<tr bgcolor="'.$color.'"><td bgcolor="white"></td><td><div style="direction:ltr;">'.$domain.'</div></td><td style="color:red;">תפוס</td></tr>';
}
}
*אינו מקבל את הצבע.