项目名称:基于PHP MySQL的学生信息管理系统本系统是用于管理学生信息的管理系统,包括基本的增删调查,系统采用PHP语言开发,使用MySQL数据库,可供初学者参考。
系统环境MySQL5.1.51-community
PHP7.3.29
1、登录页面
2、首页
3、新增学生
4、修改学生
5、项目结构
关注微信公众号:小诸葛博客,回复105免费获取项目源代码。
部分核心代码LoginController
? phpinclude './dao/LoginDao.php '; include './bean/Res.php '; header (内容类型: APP (JSON; charset=UTF-8 '; //从请求中获取原始数据$ JSON=file _ get _ contents (' PHP ://input ); //将其转换为PHP对象$data=JSON_decode($JSON )//$Param=JSON_encode($data ); $loginDao=new LoginDao (; $ RES=$ log in Dao-log in ($ data-uname,$data-upass ); $result=new Res (; if($RES ) $result-setsuccess ) ) true; $result-setData ('登录成功'); }else{$result-setsuccess(false ); $result-setData ('登录失败'); }echoJSON_encode($result );StudentController
? phpinclude './bean/User.php '; include './dao/StudentDao.php '; header (内容类型: APP (JSON; charset=UTF-8 '; //从请求中获取原始数据$ JSON=file _ get _ contents (' PHP ://input ); //将其转换为PHP对象$Param=JSON_decode($JSON ) $method=$param-method; $studentDao=new StudentDao (; $res=new Res (; sitch($method ) ) { case 'queryAll': //所有$RES-setdata ) $studentDao-queryall ); $RES-setsuccess(true ); 布雷克; case 'save': //保存$RES-setdata($studentDao-save ) $param ); $RES-setsuccess(true ); 布雷克; case 'update': //更新$ RES-setdata ($ student Dao-update ) $param ); $RES-setsuccess(true ); 布雷克; case 'delete': //删除$ RES-setdata ($ student Dao-delete ) $param ); $RES-setsuccess(true ); 布雷克; }echoJSON_encode($RES;