Jump to content

Bot Saldırılarını Nasıl Engelleyebilirim


Recommended Posts

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?

Link to comment
Share on other sites

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";
}
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...