当前位置:网站首页>(PHP graduation project) obtained based on PHP novel website management system
(PHP graduation project) obtained based on PHP novel website management system
2022-07-28 06:18:00 【BiShe source code library】
be based on php Novel website management system
The novel website management system is based on php Programming languages and mysql Database development BS Architecture system , This system is mainly divided into two roles: user and administrator , Users can log on to the website to read , Collection , evaluation , Hit list novel , You can publish your own novels , Reply to others' comments and other functions , Administrators can classify novels , Novel release , evaluation , advertisement , Register users for management , This system has complete functions , Complete code comments , Beautiful page .
One . Technical environment
php edition : 5.3 above
development tool : notepad++,sublime,phpstorm All right
database : mysql
The server : apache
Integrated environment : phpstudy
The front frame :bootstrap
Detailed technical :HTML+CSS+JS+PHP+MYSQL+PhpStudy
Two . Project documents

3、 ... and . system function

Four . Code example
<?php
// +----------------------------------------------------------------------
// | Registration function
// | Design thinking , First, judge whether the data entered by the user is correct , In determining whether the user's email has a note
// | too , Meet the conditions , Registered successfully ,ajaxReturn Function in include.php in
// +----------------------------------------------------------------------
// Reference commonly used functions
require_once('../../../config/config.php');
// Get the data sent by the front desk
$name = $_POST['name'];// Get username
$password = $_POST['password'];// Get password
$email = $_POST['email'];// Get games
$password_o = $_POST['password_o'];// Get duplicate password
// Judge user name
if(!$name) {
ajaxReturn(0,' Incorrect user name format , English plus numbers !');
}
// Determine whether the password is entered correctly
if(!is_password($password)) {
ajaxReturn(0,' The password format is incorrect , No less than 6 position !');
}
// Determine whether the mailbox is entered correctly
if(!is_email($email)) {
ajaxReturn(0,' The email format is incorrect !');
}
// Judge whether the two password entries are consistent
if($password != $password_o) {
ajaxReturn(0,' The two passwords are not the same !');
}
// Query whether the database has registered this mailbox
$sql = "SELECT * FROM users WHERE email='$email'";
$result1 = fetchAll($link,$sql);
if($result1) {
ajaxReturn(0,' I'm sorry , This email has been registered !');
}
$data = array(
'name'=>$name,
'password'=>$password,
'email'=> $email,
'addtime'=>date('Y-m-d H:i:s')
);
// Save the user's registration information to users surface , Among them $link stay include.php in
$result2 = insert($link,$data,'users');
// If the registration succeeds or fails , Return to the prompt
if(!$result2) {
ajaxReturn(0,' Registration failed !');
}else{
ajaxReturn(1,' Congratulations on your successful registration ');
}
<?php
// +----------------------------------------------------------------------
// | Login function
// | Design thinking , Get the account and password entered by the user , Verify the data entered by the user , Verification passed ,
// | Save the login information of the user to the database , And generate cookie, Prompt the user to log in successfully
// +----------------------------------------------------------------------
// Reference commonly used functions
require_once('../../../config/config.php');
// Get the login username
$name = $_POST['name'];
// Get the user's login password
$password = $_POST['password'];
// Get the login role
$role = $_POST['role'];
// Judge whether the user name entered by the user is empty
if (!$name) {
// If it is empty , Return to the prompt message
ajaxReturn(0, ' Please enter a user name ');
}
// Judge whether the password entered by the user is empty
if (!$password) {
ajaxReturn(0,' Please input a password ');
}
//sql sentence
$sql = "SELECT * FROM users WHERE name='$name' AND password='$password'";
// Query database user records ,fetchOne Function in mysql.php in
$result = fetchOne($link,$sql);
// If this user is not queried
if(!$result) {
ajaxReturn(0,' I'm sorry , Wrong login and password !');
}else {
// Save the user's session
$user = array(
'id'=>$result['id'],
'name'=>$result['name'],
'avatar' =>$result['avatar'],
'role'=>$result['role']
);
// If the user logs in
if($role == 1) {
if($result['role'] == 1){
// Set up session, Failure time 1 Hours
$_SESSION["user"]=$user;
ajaxReturn(1,' congratulations , Login successful !');
}else{
ajaxReturn(0,' I'm sorry , You are not a user !');
}
}
// If you are an administrator, log in
if($role == 2 ) {
// Determine whether you are an administrator
if($result['is_admin'] == 1) {
// Set up session, Failure time 1 Hours
$_SESSION["admin"]=$user;
// Prompt for successful login
ajaxReturn(2,' congratulations , Login successful !');
}else{
// If it's not the Administrator , Give tips
ajaxReturn(0,' I'm sorry , You're not the administrator !');
}
}
}
5、 ... and . Project screenshots


















边栏推荐
- Adaface: quality adaptive margin for face recognition image quality adaptive edge loss for face recognition
- EIGamal 密码体制描述
- 短跳线DSX-8000测试正常,但是DSX-5000测试无长度显示?
- Reversible watermarking method based on difference expansion
- 二、OpenVINO简述与构建流程
- CalendarExtender控件的中文显示问题
- 8类网线测试仪AEM testpro CV100 和FLUKE DSX-8000哪些事?
- 在Asp.net 中Cookie的用法
- 关于隔离电源断电瞬间MOSFET损坏问题分析
- 一、AMD - OpenVINO环境配置
猜你喜欢

Byte Android post 4 rounds of interviews, received 50k*18 offers, and successfully broke the situation under the layoff

三极管设计,理解饱和,线性区域和截止区

关于Fusion on Apple Silicon的谨慎猜测

端接电阻详解 信号完整系列 硬件学习笔记7

Deep learning (incremental learning) - (iccv) striking a balance between stability and plasticity for class incremental learning

Summary of common WAF interception pages

Tf.keras build neural network function expansion

Differences between processes and threads

《AdaFace: Quality Adaptive Margin for Face Recognition》用于人脸识别的图像质量自适应边缘损失

Getting started with latex
随机推荐
使用MS图表控件创建基本报表
Building neural network based on tensorflow
ESXi社区版网卡驱动再次更新
基于直方图修改的可逆数字水印方法
Nanjing University of Posts and Telecommunications CTF topic writeup (I) including topic address
USB Network Native Driver for ESXi更新到支持ESXi7.0.1
Clustering of machine learning
一、语音合成与自回归模型
Geek challenge 2019-sql injection five questions PW
Paper reading notes of field low resolution face recognition based on selective knowledge extraction
一、AMD - OpenVINO环境配置
LED发光二极管选型-硬件学习笔记3
无约束低分辨率人脸识别综述三:同质低分辨率人脸识别方法
说说ESXi虚拟交换机和端口组的“混杂模式”
在Asp.net 中Cookie的用法
Deep learning pay attention to MLPs
关于gcc :multiple definition of
Deploy the project to GPU and run
AEM线上产品推介会---线缆认证测仪
The difference between router and switch