guestbook_model=D("Common/Guestbook"); } // 留言提交 public function addmsg(){ if(!sp_check_verify_code()){ $this->error("验证码错误!"); } if (IS_POST) { if ($this->guestbook_model->create()!==false) { $result=$this->guestbook_model->add(); if ($result!==false) { $this->success("留言成功!"); } else { $this->error("留言失败!"); } } else { $this->error($this->guestbook_model->getError()); } } } }