当前位置:网站首页>(PHP graduation project) based on PHP student daily behavior management system access
(PHP graduation project) based on PHP student daily behavior management system access
2022-07-28 06:18:00 【BiShe source code library】
be based on php Student daily behavior management system
The student daily behavior management system is based on php Programming languages and mysql Database development BS Architecture system , The system is mainly divided into students , Teachers' , Administrator has three roles ; The main function of students is personal information , Comprehensive evaluation of , Apply for leave , Class daily , Lesson schedule , achievement , View certificate information ; The main function of teachers is to manage students' grades , Information , Lesson schedule , certificate , Ask for leave , Health duty , Operation assistance and other functions ; Administrators can manage students , Teachers' , Monitoring information management . This system has complete functions , Code comments are clear , For a php Graduation project reference and learning .
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
// +----------------------------------------------------------------------
// | 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 !');
}
}
}
<?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 ');
}
5、 ... and . Project screenshots






















边栏推荐
- 关于接触器线圈控制电路设计分析
- Realization of topic function
- 三极管设计,理解饱和,线性区域和截止区
- Paper reading notes of field low resolution face recognition based on selective knowledge extraction
- 《Distilling the Knowledge in a Neural Network》知识蒸馏论文解读
- Boosting unconstrained face recognition with auxiliary unlabeled data to enhance unconstrained face recognition
- Deep learning pay attention to MLPs
- ESXi社区版NVMe驱动更新v1.1
- 二、OpenVINO简述与构建流程
- 监控安装ESXi on Arm的树莓派4b的CPU温度
猜你喜欢

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

The difference and relation between TCP and UDP

Deep learning pay attention to MLPs

关于Fusion on Apple Silicon的谨慎猜测

51 single chip microcomputer independent key linkage nixie tube LED buzzer

LED发光二极管选型-硬件学习笔记3

Research on threat analysis and defense methods of deep learning data theft attack in data sandbox mode

Reinforcement learning - proximal policy optimization algorithms

D2SC-GAN:基于双深浅通道生成对抗网络的课堂场景低分辨率人脸识别

AEM线上产品推介会---线缆认证测仪
随机推荐
后门攻击与对抗样本攻击的比较研究
Research on threat analysis and defense methods of deep learning data theft attack in data sandbox mode
frameset 用法示例
Differences between processes and threads
UNL class diagram
Internet of things interoperability system: classification, standards and future development
硬件电路设计学习笔记1--温升设计
51 single chip microcomputer independent key linkage nixie tube LED buzzer
ESXi社区版NVMe驱动更新v1.1
Scenario solution of distributed cluster architecture: cluster clock synchronization
FLUKE福禄克Aircheck wifi测试仪无法配置文件?---终极解决心得
The difference and relation between TCP and UDP
D2sc-gan: low resolution face recognition of classroom scenes based on dual depth and shallow channel generation confrontation network
基于tensorflow搭建神经网络
Cyclic neural network
怎么看SIMULINK直接搭的模块的传递函数
机群作业管理系统,求解答进程方面的疑问
AEM-TESTpro K50和南粤勘察结下的缘分
What is the process of building a small program?
ESXi社区版网卡驱动再次更新