Discuss coding issues, and scripts related to PHP and MySQL.
User avatar
Posts: 179
Location: Holland Rotterdam


I`m building a hashtag system but now recently I getting some nasty spam
How can I add simply a filter to protect it ????

Code: Select all

//if hashtag is requested
if(isset($_GET['hashtag']) && !empty($_GET['hashtag'])){
$hashtag = mysql_real_escape_string(strip_tags(trim($_GET['hashtag'])));
$query = mysql_query("SELECT * FROM message WHERE hashtag LIKE '%$hashtag%' ORDER BY id DESC");
$title = "Search Result For <span style='color:red;'>".$hashtag."</span> <a href='index.php'>clear</a>";
}else{ // if not
$query = mysql_query("SELECT * FROM message ORDER BY id DESC LIMIT 15");
$title = "All Updates";
The results are comming into <li>'.$final_msg.'</li>

Code: Select all


echo $title;
//display the messages
if(mysql_num_rows($query) > 0){

while ($row = mysql_fetch_assoc($query)) {
$final_msg = convert_to_links($row['message']);
echo '<div id="posts">



Sorry, i not understand.
What nasty spam do you refer?
Where or to what do you want to add filter?
What do you want to protect?
Do you want an Anti-spam Captcha verification code like in this tutorial:

Similar Topics