时间:2024-12-04 来源:网络 人气:
PHP办公留言系统的设计与实现
```sql
CREATE TABLE `messages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`content` text NOT NULL,
`author` varchar(255) NOT NULL,
`reply_content` text,
`reply_author` varchar(255),
`create_time` datetime NOT NULL,
PRIMARY KEY (`id`)
```php
// 留言发布
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$title = $_POST['title'];
$content = $_POST['content'];
$author = $_SESSION['username']; // 假设已经登录,获取用户名
$create_time = date('Y-m-d H:i:s');
$sql =