istiyorum ki bot index.php de karşı siteden çektiğim liste veritabanına kayıtlı olanlar rengi yeşil olsun ve her eklediğim liste renk versin
yani index.php de class="betRows" a renk clası atamalı
bot index.php kısa bi döngü örneğim
<?php
for($i=0;$i<count($macl[1]);$i++) {
preg_match_all("#(.*?),'(.*?)',(.*?),'(.*?)','(.*?)',(.*?),'(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)',(.*?),'(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)','(.*?)'#",$macl[1][$i],$al);
?>
<form id="form<?php echo $i;?>" action="javascript:void(0);" onsubmit="ajax(<?php echo $i;?>);" method="POST">
<tr id="betrates" class="betRows">
<td><input type="hidden" value="<?php echo $al[2][0]?>" name="evsahibi" /><?php echo $al[2][0]?></td>
<td><input type="submit" value="Ekle"></td>
</tr>
<tr>
<td id="sonuc<?php echo $i;?>"></td>
</tr>
</form>
<?php
}jquery kodum
function ajax(i){
$('#sonuc'+i).html('Yükleniyor Lütfen Bekleyin');
$.ajax({
type:'POST',
url:'ajax.php',
data:$('#form'+i).serialize(),
success:function(cevap){
$('#sonuc'+i).html(cevap);
}
})
}ajax.php<?php
sleep(1);
require_once "ayar.php";
require_once "function.php";
$evsahibi= $_POST['evsahibi'];
$varmi = mysql_num_rows(mysql_query("select * from spor where sevsahibi='$evsahibi'"));
if($varmi>0){
echo"içerik var";
}else{
$ekle = mysql_query("INSERT INTO spor SET sevsahibi = '$evsahibi'");
echo "eklendi";
}
?>