".$addr."<#>".$pcname; $thr = $_POST[thread]; $comment = $_POST['comment']; if (preg_match($bots, $_SERVER['HTTP_USER_AGENT'])) { exit("
Known spam bots aren't allowed.
"); } elseif (preg_match($exploits, $comment)) { exit("Exploits/malicious scripting attributes aren't allowed.
"); } elseif (preg_match_all($profanity, $comment, $matches, PREG_SET_ORDER ) || preg_match_all($spamwords, $comment, $matches, PREG_SET_ORDER )) { print_r($matches); exit("Spammy language detected!!!!
If you are not a spammy thing and wish to repost without above spammy word(s) please copy your comment from here as back will lose it.
$comment
"); } elseif (preg_match_all($urls, $addr, $matches, PREG_SET_ORDER )) { print_r($matches); exit("Suspicious spammy address detected!!!!
Apologies if you are not a spammy bastard.
"); } elseif ($comment=="") { exit("Blank comment - commendably succinct!
"); } elseif ($thr=="" || $thr[0]!="0") { exit("That doesn't appear to be a comment on any of our crap!
"); } else { //*****change to your own server username & password $con = mysql_connect("server","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } //*****change to your own database name mysql_select_db("mydatabase", $con); $sql="INSERT IGNORE INTO comments (name, comment, date, thread, sender) VALUES ('$_POST[name]', '$_POST[comment]', NOW(), '$_POST[thread]', '$sender')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_close($con); //*****change me@myblog.org to your own email address $recipient = "me@myblog.org"; $title = "blog comment received"; $email = "me@myblog.org"; $headers .= "Reply-To: $email"; $headers = "From: $email"; $message .= "{$_POST['name']} said:\n"; $message .= "{$_POST['comment']} \n"; mail($recipient,$title,$message,$headers); } ?>