This article mainly introduces the simple implementation of PHP message board function, which has certain reference value. Now I share it with you. Friends in need can refer to it.
This article mainly teaches you how to simply implement PHP. The message board function has certain reference value. Interested friends can refer to it
The example in this article shares the specific implementation code of the PHP message board function for your reference. The specific content is as follows
HTML code
PHP留言本
留言者: {$vo.nickname} | 邮箱: {$vo.email} 时间: {$vo.replytime}
内容: {$vo.content} {$vo.id}楼
PHP code
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(); }
Data table:(table name is daili_liuyan_guestbook)
Finally Rendering:
##Thank you for watching~
Related recommendations:Simple implementation of PHP reading and outputting XML file data
Teach you how to simply implement PHP file management_PHP tutorial
The above is the detailed content of Simple implementation of PHP message board function. For more information, please follow other related articles on the PHP Chinese website!