a simple php comment spam hack
-
hey all:
its what i call, um “dynamically manual” ; )
on my index page (http://www.latinosfortexas.com) i have a script to show the last 8 posts, and last 8 comments from the blog.
of course in the last 24 hours “poker” seems to have been reaaaaal popular. so i simply added an include on my index page:
include("spamdeleteauto.php");which points to a pretty straightforward php page to simply delete comments which include the word “poker”.
wp_comments
<?php<br />
include("dbaseinfo.inc.php");
mysql_connect($hostname,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "DELETE FROMWHEREcomment_contentLIKE '%poker%'";
$result=mysql_query($query);
mysql_close()
?>
i know, a little brute force but works well. i think i ll make a table of spamwords and loop thru them, but for now, tho its not stopped the poker spam, it HAS stopped it from being seen by deleting it.
just sharing,
m
The topic ‘a simple php comment spam hack’ is closed to new replies.