| $this->dsql->ExecuteNoneQuery("UPDATE`dede58_vote`SET totalcount='".($this->VoteInfos['totalcount']+1)."',votenote='".addslashes($items)."' WHERE aid='".$this->VoteID."'"); |
| $this->dsql->ExecuteNoneQuery("UPDATE`dede58_vote`SET totalcount='".($this->VoteInfos['totalcount']+1)."',votenote='".mysql_real_escape_string($items)."' WHERE aid='".mysql_real_escape_string($this->VoteID)."'"); |
其實也就是addslashes()改為mysql_real_escape_string()對模塊投票提交過來的數據進行轉義后再向數據庫提交,這樣轉義之后就會把例如逗號,雙引號全部轉義成單斜杠了。這樣就可以有效的防范投票的時候被SQL注入的風險了。
新聞熱點
疑難解答