今天就跟大家聊聊有關(guān)怎么在項(xiàng)目中PHP實(shí)現(xiàn)一個(gè)留言板功能,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
HTML代碼
PHP留言本
留言者: {$vo.nickname} | 郵箱: {$vo.email} 時(shí)間: {$vo.replytime}內(nèi)容: {$vo.content} {$vo.id}樓
PHP代碼
public function hierarchicalauthority(){ if(isset($_POST['liuyan'])) { $data['nickname']=$_POST['nickname']; $data['content']=$_POST['content']; $data['email']=$_POST['email']; $data['status']=1; $data['replytime']=date('Y-m-d H:i:s',time()); // print_r($data);die(); $user=M('daili_liuyan_guestbook'); $maxid=$user->max('id'); $data['id']=$maxid+1; $user->add($data); // print_r($_POST);die(); } $guestbook = D('daili_liuyan_guestbook')->select(); $this->assign('guestbook',$guestbook); $this->display(); }
看完上述內(nèi)容,你們對(duì)怎么在項(xiàng)目中PHP實(shí)現(xiàn)一個(gè)留言板功能有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。