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