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


















边栏推荐
- Cluster operation management system, to answer questions about the process
- Reinforcement learning - proximal policy optimization algorithms
- Deploy the project to GPU and run
- Deep learning (incremental learning) -- iccv2021:ss-il: separated softmax for incremental learning
- Reinforcement learning - incomplete observation problem, MCTs
- 使用PowerCli来创建自定义ESXi ISO镜像
- 用于快速低分辨率人脸识别模型训练的改进知识蒸馏《Improved Knowledge Distillation for Training Fast LR_FR》
- Convolutional neural network
- ESXi 社区版网卡驱动
- Realization of topic function
猜你喜欢

神经网络学习

Solution to the crash after setting up a cluster

51单片机独立按键联动数码管LED蜂鸣器

《On Low-Resolution Face Recognition in the Wild:Comparisons and New Techniques》低分辨率人脸识别论文解读

Notes on the thinking of software analysis and library acquisition of a Taobao customer

Deep learning - metaformer is actually what you need for vision

USB Network Native Driver for ESXi更新到支持ESXi7.0.1

电快速脉冲群(EFT)设计-EMC系列 硬件设计笔记4

Why is the kotlin language not popular now? What's your opinion?

ESXi on Arm 10/22 更新
随机推荐
Summary of command injection bypass methods
4、 Model optimizer and inference engine
On low resolution face recognition in the wild:comparisons and new technologies
《AdaFace: Quality Adaptive Margin for Face Recognition》用于人脸识别的图像质量自适应边缘损失
2、 Openvino brief introduction and construction process
Internet of things interoperability system: classification, standards and future development
Difference between shallow copy and deep copy
D2SC-GAN:基于双深浅通道生成对抗网络的课堂场景低分辨率人脸识别
The difference between router and switch
CString转char[]函数
TVS管参数与选型
后门攻击与对抗样本攻击的比较研究
一、AMD - OpenVINO环境配置
利用辅助未标记数据增强无约束人脸识别《Boosting Unconstrained Face Recognition with Auxiliary Unlabeled Data》
EIGamal 密码体制描述
Differences between processes and threads
Overview of unconstrained low resolution face recognition III: homogeneous low resolution face recognition methods
51 single chip microcomputer independent key linkage nixie tube LED buzzer
Deep learning (I): enter the theoretical part of machine learning and deep learning
神经网络学习