turkoglu98 Posted August 21, 2014 Share Posted August 21, 2014 arkadaşlar benim sorunun biraz farklı şöyle anlatayım like.php dosyam var ve kullanıcılar bir gönderiyi beğendiğinde like.php şöyle bir ajax ile post yapıyor $(function(){ $('.likeTrigger').on('click', function(){ var paylasim_pay_id = $(this).attr("id"); var uye_id = '69'; var checkStatus = $(this).children('.like'); checkStatus.parent().attr("disabled", "disabled"); if (checkStatus.length > 0) { $.ajax({ type: 'post', url : 'like.php', data: {'uye_id': uye_id , 'paylasim_pay_id': paylasim_pay_id}, dataType: "json", success: function(cevap){ checkStatus.toggleClass('unlike'); checkStatus.parent().removeAttr("disabled"); if (cevap.ok){} } }); }else{ $.ajax({ type: 'post', url : 'likeD.php', data: {'uye_id': uye_id , 'paylasim_pay_id': paylasim_pay_id}, dataType: "json", success: function(cevap){ checkStatus.toggleClass('like'); checkStatus.parent().removeAttr("disabled"); if (cevap.oke){} } }); } return false; }); }); sonra ben sistem açıklarını ararken like.php 'ye dışardan bir bot yapılabileceğini ve dakikalar içerisinde 1000 beğeni yapabilineceğini gördüm. mesela bunu sonsuz kere yapan bir program yazılsa hem site ye zarar hemde mysql ye zarar olur. bunu engellemeyi nasıl yapabilirim? Quote Link to comment Share on other sites More sharing options...
weyso Posted August 25, 2014 Share Posted August 25, 2014 cookie ile şöyle bir mantık olabilir. kodlar da hata olabilir sandece mantığını göstermek istedim $uye= 68; if ( !$_COOKIE["uye_".$uye] ){ echo "like butonu görünmesin"; query("UPDATE haber SET like = like + 1 WHERE id = '$konuid'"); setcookie("konu_".$konuid, "_", time()+28800); }else{ echo "like butonu gözüksün"; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.