嘿,夥計們,今天我訪問了我的網站,我看到有人在我的故事表中插入超過1000查詢防垃圾郵件
我的腳本是在PHP/MySQL和我已經啓用了驗證碼,我不知道他怎麼能做這樣的事情
一個簡單的表格,並在另一個函數,它檢查$ VAR和驗證它們,然後在數據庫中插入
我敢肯定,他是用一個機器人做這樣的事情
IM真的困惑
這是我的功能驗證,並插入到表
function submitStory($name, $address, $subject, $story, $storyext, $topic, $alanguage,$tags) {
$subject = check_words(check_html(addslashes($subject), "nohtml"));
$story = check_words(addslashes($story), "nohtml");
$storyext = check_words(addslashes($storyext), "nohtml");
$result = $db->sql_query("INSERT INTO ".$prefix."_stories
(sid,catid,aid,title,time,hometext,bodytext,newsref,newsreflink,comments,counter,topic,informant,notes,ihome,alanguage,acomm,hotnews,haspoll,pollID,associated,tags,approved,section)
VALUES
(NULL, '$catid', '', '$subject', now(), '$story', '$storyext', '','', '0', '0', '$topic', '$name', '', '', '$alanguage', '', '', '0', '0', '','$tag_ids','2','news')");
mysql_error();
include ('header.php');
echo "<font class=\"content\"><b>"._THANKSSUB."</b><br><br>"
.""._SUBTEXT.""
."<br>"._WEHAVESUB." $waiting "._WAITING."";
include ('footer.php');
}
您有一個SQL注入漏洞。 您需要使用參數。 – SLaks 2010-03-01 18:27:17
@Mac:供參考:http://www.php.net/manual/en/pdo.prepared-statements.php。關於使用PDO的教程,包括準備好的語句:http://www.kitebird.com/articles/php-pdo.html – outis 2010-03-01 18:53:30
您確實在檢查驗證碼是否有效? – jasonbar 2010-03-01 19:20:41