当前位置:网站首页>(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


















边栏推荐
- Interviewer: let you design a set of image loading framework. How would you design it?
- 无约束低分辨率人脸识别综述一:用于低分辨率人脸识别的数据集
- Internet of things interoperability system: classification, standards and future development
- Geek challenge 2019-sql injection five questions PW
- 5、 Video processing and GStreamer
- Deep learning (I): enter the theoretical part of machine learning and deep learning
- Neural network learning
- ESXi on Arm 10/22 更新
- DSX-PC6跳线模块,何时更换JACK插座?
- Difference between shallow copy and deep copy
猜你喜欢

神经网络实现鸢尾花分类

Never leave its origin - bluecms1.6 vulnerability of the controller's shooting range

The difference between router and switch

TVS管参数与选型

EIGamal cryptosystem description

Distributed cluster architecture scenario optimization solution: distributed scheduling problem

深度学习(一):走进机器学习与深度学习理论部分

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

三、OpenVINO实战:图像分类

Reinforcement learning - continuous control
随机推荐
Getting started with latex
Which enterprises are suitable for small program production and small program development?
ESXi on ARM v1.2 (2020年11月更新)
Summary of common WAF interception pages
Differences between processes and threads
Reinforcement learning - continuous control
dsp和fpga的通讯
File upload vulnerability summary
基于直方图修改的可逆数字水印方法
Model inversion attacks that exploit confidence information on and basic countermeasures
开关电源电路EMI设计在layout过程中注意事项
Interpreting the knowledge in a neural network
无约束低分辨率人脸识别综述三:同质低分辨率人脸识别方法
《AdaFace: Quality Adaptive Margin for Face Recognition》用于人脸识别的图像质量自适应边缘损失
D2SC-GAN:基于双深浅通道生成对抗网络的课堂场景低分辨率人脸识别
Byte Android post 4 rounds of interviews, received 50k*18 offers, and successfully broke the situation under the layoff
无约束低分辨率人脸识别综述二:异构低分辨率人脸识别方法
关于隔离电源断电瞬间MOSFET损坏问题分析
5、 Video processing and GStreamer
一、AMD - OpenVINO环境配置