# bbs **Repository Path**: phpxuexiba/bbs ## Basic Information - **Project Name**: bbs - **Description**: bbs论坛项目,针对初级,务必看完基础教程后,包括了解,html (特别是一些 table ,head等),css(稍微看),javascript(简单看),php(认真看),mysql(认真看)。做练习的时候发不懂的时候,第一时间查询这些手册。 重点放在了PHP编写上,前端样式不用太纠结 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2023-07-10 - **Last Updated**: 2023-07-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # bbs论坛项目 重点放在了PHP编写上,前端样式不用太纠结~~ 数据提交都是采用FORM表单的形式 #### 项目结构 /bbs/ ``` sh ├── config/ # 项目配置文件 ├── config.php # 配置文件 ├── core/ # 核心文件 ├── mysqlDB.php # 数据库连接文件 ├── upload.php # 上传文件操作 ├── model/ # 业务模块 ├── list_father.php #板块详情 ├── login.php #登入 ├── publish.php #帖子发布 ├── publish_deal.php #贴子处理 前端post后的数据 ├── register.php #注册 ├── reply.php #回复 ├── reply_deal.php #回复处理 ├── show.php #帖子详情 ├── userInfo.php #用户详情 ├── validate.php #登入验证 ├── public/ # 静态资源存放目录 ├── uploads/  # 文件上传目录 ├── views/ # 视图目录 ├── index.html   ├── list_father.html ├── list_son.html ├── login.html ├── publish.html ├── quote.html ├── register.html ├── reply.html ├── show.html ├── index.php # 项目入口文件 ├── init.php # 项目初始化文件 ``` ### 项目介绍 * 项目进行了简单的前后端分离 * 功能实现:登录(结合session和cookie)、注册、注销、查看帖子、发表帖子、帖子分页、点赞、帖子回复、删除帖子 ```安装 1 在phpstudy中网站管理--》新增网站,输入网站域名(www.bbs.com),php版本选7.4,保存添加。 2 浏览器访问 https://gitee.com/phpxuexiba/bbs 然后把该项目fork到自己仓库中(登入你的码云账号) 3 到刚才phpstudy新增加的网站下面,git clone 你的项目地址 打开浏览器,输入http://www.bbs.com/你的仓库名/ 就可以看到页面了(需要安装git) (以上这三步,后续有项目都是同理按这个操作) 4 把本目录下的sql,通过navicate,或者phpmyadmin新建数据库名为bbs,再将bbs.sql导入到数据库中, 同时修改项目中的config/config.php,按要求修改你的数据库参数配置,登入的初始化用户为,test 密码:test 5 有一个任务须知:按照这个做然后提交代码 ``` #### 数据库方面 * 创建用户表 ```sql create table user( user_id int unsigned primary key auto_increment comment '主键ID', user_name varchar(20) not null unique key comment '用户名', user_password char(32) not null comment '用户密码' ); ``` * 创建发帖表 ```sql create table publish( pub_id int unsigned primary key auto_increment comment '主键ID', pub_title varchar(50) not null comment '发帖标题', pub_content text not null comment '发帖内容', pub_owner varchar(20) not null comment '发帖者', pub_time int unsigned not null comment '发帖时间', pub_hits int unsigned not null default 0 comment '浏览次数' ); ``` * 创建回帖表 ```sql create table reply( rep_id int unsigned primary key auto_increment comment '主键ID', rep_pub_id int unsigned not null comment '外键,指向回帖人的ID', rep_user varchar(20) not null comment '回复者', rep_content text not null comment '回复内容', rep_time int unsigned not null comment '回复的时间戳' ); ``` * 其他表。。包括 板块表自行设计 ```sql create table 表( ); ``` #### 项目总结 * 本项目相对简单,涉及的每一行代码都必须懂 * 写的大多都是纯业务的代码,代码质量有待提高,简单知道数据库设计,php交互流程 * 项目适合入门的小伙伴 ##### 始终坚信 敢于尝试的你 其实已经进步了 ^_^