Simple implementation of PHP message board function

不言
Release: 2023-03-23 20:00:02
Original
2315 people have browsed it

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.replytime}

内容: {$vo.content} {$vo.id}楼

Copy after login

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(); }
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!