当前位置:网站首页>Acquisition of student status management system based on PHP (PHP graduation design)
Acquisition of student status management system based on PHP (PHP graduation design)
2022-07-28 05:50:00 【BiShe source code library】
be based on php Student status management system
Student status management system is based on php and mysql Developed system , The system is divided into students , Teachers' , Administrator has three roles , Among them, students modify personal information , Check your grades ; The teacher checks the student's student status , Add grades , Check your grades ; Administrators can check the institutions , major , Course , Teachers' , class , Manage students' information . This system has complete functions , The system is simple , For a php Graduation design and php Curriculum design reference and learning .
One . Technical environment
php edition : 5.2( Must be php5.2 Version of )
development tool : notepad++,sublime,phpstorm All right
database : mysql
The server : apache
Integrated environment : phpstudy
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 !');
}
}
}
5、 ... and . Project screenshots















边栏推荐
猜你喜欢

CAD-GIS数据转换

(php毕业设计)基于php学生日常行为管理系统获取

NRF51822 回顾总结

Microsoft Edge浏览器插件(1)

结果填空 购物单(教你用Excel解决)

Distance toolbar in ArcMap (distance)

A file upload tool website written by individuals

基于php学生学籍管理系统获取(php毕业设计)

Time setting in curd component

Review of metallurgical physical chemistry --- electrodeposition and reduction process of metals
随机推荐
pytorch安装----CPU版的
Review of metallurgical physical chemistry --- electrodeposition and reduction process of metals
new,let,var,const以及暂时性死区,xml和json的区别
结果填空 购物单(教你用Excel解决)
设置滚动条
Microsoft Edge浏览器插件(2)
ES6----解构赋值
Delete specific elements in order table OJ
Thinking on Architecture Design (SSO design)
标准C语言学习总结6
结果填空 啤酒和饮料
Microsoft edge browser plug-in (2)
wangeditor(@4.7.15)-轻量级的富文本编辑器
DOM——事件
书籍-聪明的投资者
ArcGIS之Model Builder
树莓派串口配置
GD32F407 移植FreeRTOS+Lwip
DOM模型的相关概念和操作
On a wonderful journey