Easily Protect Spamming in your Website/blog - Desk2Blog - A Technology Blogging Blog

Latest

Saturday, January 24, 2015

Easily Protect Spamming in your Website/blog

Just following a simple trick!!

Many of us do have a favorite blog. We get hurt if anybody does spamming in our blog and even Google community considers it as a spamming site. Thus out visitor get reduced to this spamming blog. So, today I will introduce you to a trick “How to stop spamming” in my blog www.desk2blog.com. So, let’s see how it works!
First, create a file named spamCheack.php in your hosting folder then include the code shown below in that file.

Read Also: How To Protect Your Eyes From Computer


<?php
function checkSpam($text){
$spamDomains=array("com","net","org","in­
fo","biz","mobi","ws","tk","ml","cf","in","pw","ru","com.bd");
foreach($spamDomains as $spamTld){
if(preg_match('/(.*)\.'.$spamTld.'/',$text)){
$itSpam=1;
}
else {
$itSpam=0;
}
}
}
?>
Then include this file where you verify spam. Now you can verify any writing with this and you need just call a function for this.
Example:
You want to verify “visit spamm.com ”
So, checkSpam("Visit spammm.com ");
if($itSpam==1){
echo “to stop Spam as your wish;
}





To get more trick like this visit our site regularly.
Thank you and stay with us.