예제 #1
0
파일: CMSView.php 프로젝트: yiuked/tmcart
 public function postComment()
 {
     global $smarty;
     session_start();
     if ($_SESSION['validate_code'] == strtolower(Tools::getRequest('validate_code'))) {
         $comment = new CMSComment();
         $comment->copyFromPost();
         if ($comment->add()) {
             $this->_success = '添加评论成功,请等待管理员审核哟!';
         } else {
             $this->_errors = $comment->_errors;
         }
     } else {
         $this->_errors[] = '验证码错误!';
     }
 }