ok.. I came up with something by myself. Here is the code in case someone is interested in a spam filter.

Regards, Merlin

###################################################
# Check for spam

$stmt="
        SELECT
                keyword,
                weight
        FROM
                Table
";

$row = db_get_row2($stmt);

$result = execute_stmt($stmt, $link);
while ($row = db_get_row($result)){
        $keyword[]      = $row->keyword;
        $weight[]       = $row->weight;
};      
$num_results = db_numrows($result);     

$mystring = $message;
for ($i=0;$i<$num_results;$i++){
        $findme  = $keyword[$i];
        $pos = strpos($mystring, $findme);
        if ($pos !== false){ // this seems to be spam!
                $spam_level += $weight[$i];
                $triggered_keywords .= $keyword[$i].', ';
        }
}

if ($spam_level >= 4){ // this seems to be spam!
        // do whatever
}
###################################################

Merlin wrote:

Hi there,

I am running a community site in php, where members can be contacted through a web form. Yesterday a guy contacted about 50 of those members with a spam text.

Now I am trying to find a way to identify spam text via php. This looks like a common task to me, so I hope that I have not to invent the wheel twice. Maybe someone knows a good script to do this?

Basicly it looks like that the text has to be checked against certain key words and if they reach a certain amount of hits it is spam text.
Has anybody a good idea on how to start on this?


Thank you for any hint,

Merlin

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to