您好,欢迎访问一九零五行业门户网

一个简单的PHP Web论坛

1、需求分析
通过发表文章开始新的讨论话题发表文章来回复已有的文章查看发表的文章查看论坛中的交谈话题查看文章之间的关系,也就是,查看哪篇文章是另外文章的回复2、解决方案
2.1 论坛设计
2.2 web论坛应用程序中用到的文件
文件名称
类型
描述
index.php
应用程序
用户进入站点看到的主页。包括该站点中所有文章的可扩展及删除的列表
new_post.php
应用程序
用来发表新文章的表单
store_new_post.php
应用程序
保存已输入到new_post.php表单中的文章
view_post.php
应用程序
显示一篇单独的文章及回复它的文章的列表
treenode_class.php
函数库
包含节点类,我们将要用它来显示文章的继承关系
include_fns.php
函数库
将该程序中用到的所有其他函数库放在一起(其他库类型文件在这里列出)
data_valid_fns.php
函数库
数据检验函数
db_fns.php
函数库
数据库连接函数
discussion_fns.php
函数库
处理存储及重新获得发表的文章的函数
output_fns.php
函数库
输出html的函数
create_database.sql
sql
建立该程序所需要数据库的sql脚本
3、实现数据库
create database discussion; #创建论坛数据库use discussion; #使用论坛数据库create table header #创建数据头表( parent int not null, #父文章的postid poster char(20) not null, #该文章的作者 title char(20) not null, #该文章的标题 children int default 0 not null, #该文章是否有回复,0无,1有,默认0 area int default 1 not null, #备用于扩展时,实现多个论坛的多个版块 posted datetime not null, #该文章的发表的时间和日期 postid int unsigned not null auto_increment primary key #每篇文章的唯一的id);create table body #创建正文表( postid int unsigned not null primary key, #每篇文章的唯一的id message text #该文章的正文);grant select,insert,update,deleteon discussion.*to discussion@localhost identified by 'password';
4、实现源代码
下载地址:一个简单的php web论坛
以上就介绍了一个简单的php web论坛,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
其它类似信息

推荐信息