My simple spam detector function lol

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    My simple spam detector function lol

    it can detect 3 part domain name and it wont bother in normal text
    PHP Code:


    function check_domain($text)
        {
        
        
    $check_domain_in_string "^([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,5})$";
        
    /*
        you can use instead,if you only wanted to detect known domain.
        $check_domain_in_string = "^([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.com|edu|co.uk|gov|biz|tv|info|net|co.cc|in$";
        */
            
    if (ereg($check_domain_in_string$text)) 
        {
            return 
    true;
        break;    
        }                     
        return 
    false;
        } 
    PHP Code:
    /* I don't know everything hehe */ 
    Find me on facebook

    #2
    i cud always write dot com pmpl jp.

    Comment


      #3
      or if u wer smart u wud just block the http:// becus u dont need .com .net etc u can use http://101.32.244.10 and people will stil get to yr domain









      Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer..
      Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free

      Comment


        #4
        Originally posted by ozziemale31 View Post
        or if u wer smart u wud just block the http:// becus u dont need .com .net etc u can use http://101.32.244.10 and people will stil get to yr domain
        hehehe people hardly write http or www in normal text and i said its a symple fuction lol detect only valid domain from given text,

        change
        PHP Code:
        $check_domain_in_string "^([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,5})$"
        to

        PHP Code:
        $check_domain_in_string "^([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([a-zA-Z0-9]{2,})$"
        then it can detect your ip domain :p

        Added after 3 minutes:

        Originally posted by CreativityKills View Post
        i cud always write dot com pmpl jp.
        its a sad news :p
        Last edited by Ponick; 20.06.11, 08:57.
        PHP Code:
        /* I don't know everything hehe */ 
        Find me on facebook

        Comment


          #5
          You gave me an idea.
          Why not take all the domains in the file, it would not be large and the certainly there somewhere on the net ready, loop through all and preg_match them and if there is a link, to stop entry and throw a notice, or simply search and replace parts matched with preg_replace.
          <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

          Comment


            #6
            Originally posted by arnage View Post
            You gave me an idea.
            Why not take all the domains in the file, it would not be large and the certainly there somewhere on the net ready, loop through all and preg_match them and if there is a link, to stop entry and throw a notice, or simply search and replace parts matched with preg_replace.
            luk dnt bother urself wit dat mehn just let d sleepin dog lie

            Comment

            Working...
            X