本系统主要架构图如上图所示。PS:register_check.php的自动注册代码写在check.php里了。

使用数据库的两张表,user_info用户信息表和stu_info学生成绩信息表。

提供登录服务:分为管理员登录和学生登录,若登录时输入数据库中没有的账号 和密码的时候系统会自动注册,即将新账号信息写入user_info中去。

学生登录只可以进行查询操作,管理员登录可以进行增删和查操作,注册新账号的权限都是学生。

接下来上代码:

login.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>信息查询界面</title>
<style type = "text/css">a{text-decoration: none;font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);}a:link{color:#00FFFF;}/*未访问的颜色 蓝色*/a:hover{color:#FF00FF;}/*鼠标放上去的颜色(没起作用) 紫色*/a:visited{color:#00FFFF;}/*访问过的颜色 蓝色*/a:active{color:#FF00FF;}/*选定的代码 紫色*/
</style>
</head>
<!--这是学生端的查询界面,不提供返回管理员页面的接口-->
<body>
<div style="font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);" align="center"><p>请输入学生的学号进行查询操作</p><p>如果要查询所有学生信息请输入“所有”进行查询</p>
</div>
<div style="height:180px;width:180px;margin:0px auto;" align="right"><p sytle="text-align:center;">
<img src="宅舞.gif" width="160" height="160" align="right"/>
</p>
</div>
<form action="select_opt_stu.php" method="post" style="margin: 35px auto;padding:30px;box-shadow: 1px 1px 2px 1px #aaaaaa;border-radius: 3px;width:380px;"><input  type="text" name="check"  style = "background-color: rgb(250, 255, 189) !important; border-radius: 3px;box-shadow: none; color: rgb(0, 0, 0);line-height: 26px;width:240px;" placeholder="请输入要查询学生的学号"><input type="submit" value="查询" style ="height : 36px;border:1px;background-color:#00bee7;color:#fff;width:72px;border-radius: 3px;">
</form></body></html>

check.php

<title>验证账号密码后台程序</title>
<meta charset="utf-8"><?phpfunction get_str($str){$val = ($_POST[$str])?$_POST[$str]:null;return $val;}$user = get_str("username");$pass = get_str("password");if($user==null or $pass == null){?><script type="text/javascript">alert("用户名或密码为空,请重新输入");window.location.href="login.html";</script><?php}$con = mysql_connect("localhost","root","root") or die("数据库链接失败");if(!$con){?><script type = "text/javascript">alert("连接服务器失败");window.location.href = "login.html";</script><?php}$sel = mysql_select_db("SGMSystem",$con) or die("数据库选择失败");if(!$sel){?><script type = "text/javascript">alert("选择数据库失败");window.location.href = "login.html";</script><?php}$sql = "select * from user_info where username = '$user'";//echo $sql."<br>";$info = mysql_query($sql,$con);echo $info;$num = mysql_num_rows($info);if($num == null){//没有查找到,表示要注册$ins = "insert into user_info (username,password,is_manager) values('$user','$pass',0)";$info1 = mysql_query($ins,$con);//注册成功,返回登陆界面重新登录?><script type="text/javascript">alert("注册成功,返回登陆界面重新登录");window.location.href="login.html";</script><?php} else{//登录成功$row = mysql_fetch_array($info);//echo $row['password'];}if($row['password']==$pass){if($row['is_manager'] == 1){//是管理员?><script type = "text/javascript">alert("管理员登录成功");window.location.href = "welcome_mag.html";</script><?php }?><?phpif($row['is_manager'] != 1){//普通用户登录//直接进入查询界面(学生端的查询界面不提供返回服务选择界面的接口)?><script type = "text/javascript">alert("普通用户登录成功");window.location.href = "select_stu.html";</script><?php }}else{?><script type = "text/javascript">alert("密码错误");window.loaction.href = "login.html";</script><?php}mysql_close($con);?>

welcom_mag.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎界面</title>
<style>a{text-decoration: none;font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);}a:link{color:#00FFFF;}/*未访问的颜色 蓝色*/a:hover{color:#FF00FF;}/*鼠标放上去的颜色(没起作用) 紫色*/a:visited{color:#00FFFF;}/*访问过的颜色 蓝色*/a:active{color:#FF00FF;}/*选定的代码 紫色*/</style>
</head>
<div style="font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);" align="center">欢迎管理员登录,您可以进行所有操作</div>
<div style="height:180px;width:180px;margin:0px auto;" align="right"><p sytle="text-align:center;">
<img src="宅舞.gif" width="160" height="160" align="right"/>
</p>
</div><div style="font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);" align="center">请选择您需要的服务</div>
<div style="height:100px;width:240px;margin:0px auto;" align="center"><p><a href="insert.html" align="center" >输入学生成绩信息</a></p><p><a href="select_mag.html" align="center">查询学生信息</a></p><p><a href="delete.html" align="center">删除学生信息</a></p>
</div>
<body>
</body>
</html>

select_mag.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>信息查询界面</title>
<style type = "text/css">a{text-decoration: none;font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);}a:link{color:#00FFFF;}/*未访问的颜色 蓝色*/a:hover{color:#FF00FF;}/*鼠标放上去的颜色(没起作用) 紫色*/a:visited{color:#00FFFF;}/*访问过的颜色 蓝色*/a:active{color:#FF00FF;}/*选定的代码 紫色*/
</style>
</head><body>
<div style="font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);" align="center"><p>请输入学生的学号进行查询操作</p><p>如果要查询所有学生信息请输入“所有”进行查询</p>
</div>
<div style="height:180px;width:180px;margin:0px auto;" align="right"><p sytle="text-align:center;">
<img src="宅舞.gif" width="160" height="160" align="right"/>
</p>
</div>
<form action="select_opt.php" method="post" style="margin: 35px auto;padding:30px;box-shadow: 1px 1px 2px 1px #aaaaaa;border-radius: 3px;width:380px;"><input  type="text" name="check"  style = "background-color: rgb(250, 255, 189) !important; border-radius: 3px;box-shadow: none; color: rgb(0, 0, 0);line-height: 26px;width:240px;" placeholder="请输入要查询学生的学号"><input type="submit" value="查询" style ="height : 36px;border:1px;background-color:#00bee7;color:#fff;width:72px;border-radius: 3px;">
</form>
<div style="height:100px;width:240px;margin:0px auto;" align="center"><p><a href="welcome_mag.html" align="center" >返回服务选择页面</a></p>
</div>
</body></html>

select_opt.php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>查询结果显示界面</title>
</head>
<style type = "text/css">a{text-decoration: none;font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);}a:link{color:#00FFFF;}/*未访问的颜色 蓝色*/a:hover{color:#FF00FF;}/*鼠标放上去的颜色(没起作用) 紫色*/a:visited{color:#00FFFF;}/*访问过的颜色 蓝色*/a:active{color:#FF00FF;}/*选定的代码 紫色*/
</style>
<body><div style="font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);" align="center">查询的结果如下</div><div style="height:180px;width:180px;margin:0px auto;" align="right"><p sytle="text-align:center;">
<img src="宅舞.gif" width="160" height="160" align="right"/>
</p>
</div>
<div style="border:1px;border-color: #00bee7" align="center" >
<center><table style="border: solid 1px;border-color:#09F;" align ="center" width=60% ><tr ><td width=90px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">学号</td><td width=90px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">姓名</td><td width=90px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">班级</td><td width=60px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">性别</td><td width=60px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">语文</td><td width=60px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">英语</td><td width=60px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">数学</td><td width=60px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">理综</td><td width=60px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">总分</td></tr></div>
<?phpfunction get_str($str){$val = ($_POST[$str])?$_POST[$str]:null;return $val;}$sel = get_str("check");if($sel == null){
?><script type="text/javascript">alert("输入不能为空,请重新输入");window.location.href="select.html";</script>
<?php}$con = mysql_connect("localhost","root","root");if(!$con){?><script type="text/javascript">alert("数据库连接失败");window.location.href="select.html";</script><?php}mysql_select_db("SGMSystem");if($sel != "所有"){$sql = "select * from stu_info where id = $sel";$info = mysql_query($sql,$con);$num = mysql_num_rows($info);if($num){$row = mysql_fetch_row($info);echo $row[0].$row[1].$row[2].$row[3].$row[4].$row[5].$row[6].$row[7].$row[8];}else{?><script type="text/javascript">alert("查询失败");window.location.href="select.html";</script><?php}if($row){echo "<tr><td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[0]."</td> <td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[1]."</td> <td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[2]."</td><td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[3]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[4]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[5]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[6]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[7]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[8]."</td></tr>";}}else{$sql = "select * from stu_info";$info = mysql_query($sql,$con);$num = mysql_num_rows($info);if($num){//查询成功while($row = mysql_fetch_row($info)){//显示所有信息echo "<tr><td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[0]."</td> <td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[1]."</td> <td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[2]."</td><td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[3]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[4]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[5]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[6]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[7]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[8]."</td></tr>";}}else{?><script type="text/javascript">alert("查询失败");window.location.href="select.html";</script><?php}}
?>
</table>
</center>
<div style="height:100px;width:240px;margin:0px auto;" align="center"><p><a href="select_mag.html" align="center" >返回查询页面</a></p>
</div>
</body>
</html>

insert.html:

<html>
<head><title>增添学生成绩数据</title><meta charset="utf-8"><style type = "text/css">a{text-decoration: none;font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);}a:link{color:#00FFFF;}/*未访问的颜色 蓝色*/a:hover{color:#FF00FF;}/*鼠标放上去的颜色(没起作用) 紫色*/a:visited{color:#00FFFF;}/*访问过的颜色 蓝色*/a:active{color:#FF00FF;}/*选定的代码 紫色*/
</style></head><body><div style="font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);" align="center">请填写表单以添加数据</div><div style="height:180px;width:180px;margin:0px auto;" align="right"><p sytle="text-align:center;">
<img src="宅舞.gif" width="160" height="160" align="right"/>
</p>
</div><div style="border:1px;border-color: #00bee7" align="center"><form action="mysql_opt.php" method="post" style="margin:35px auto;padding:30px;box-shadow:1px 1px 2px 1px #aaaaaa;border-radius: 3px;width:380px;"><ul><li>学号:<input type="text" name="number" style = "background-color: rgb(250, 255, 189) !important; border-radius: 3px;box-shadow: none; color: rgb(0, 0, 0);line-height: 26px;width:200px;" placeholder="请输入学号(唯一)"></li><li>姓名:<input type="text" name="stuname" style = "background-color: rgb(250, 255, 189) !important; border-radius: 3px;box-shadow: none; color: rgb(0, 0, 0);line-height: 26px;width:200px;" placeholder="请输入姓名"></li><li>班级:<input type="text" name="class" style = "background-color: rgb(250, 255, 189) !important; border-radius: 3px;box-shadow: none; color: rgb(0, 0, 0);line-height: 26px;width:200px;" placeholder="请输入班级(可全使用字符)"></li><li>性别:<input type="text" name="sex" style = "background-color: rgb(250, 255, 189) !important; border-radius: 3px;box-shadow: none; color: rgb(0, 0, 0);line-height: 26px;width:200px;" placeholder="请输入性别"></li><li>语文:<input type="text" name="chinese" style = "background-color: rgb(250, 255, 189) !important; border-radius: 3px;box-shadow: none; color: rgb(0, 0, 0);line-height: 26px;width:200px;" placeholder="请输入语文成绩(满分150)"></li><li>数学:<input type="text" name="maths" style = "background-color: rgb(250, 255, 189) !important; border-radius: 3px;box-shadow: none; color: rgb(0, 0, 0);line-height: 26px;width:200px;" placeholder="请输入数学成绩(满分150)"></li><li>英语:<input type="text" name="english" style = "background-color: rgb(250, 255, 189) !important; border-radius: 3px;box-shadow: none; color: rgb(0, 0, 0);line-height: 26px;width:200px;" placeholder="请输入英语成绩(满分150)"></li><li>理综:<input type="text" name="synthesis" style = "background-color: rgb(250, 255, 189) !important; border-radius: 3px;box-shadow: none; color: rgb(0, 0, 0);line-height: 26px;width:200px;" placeholder="请输入英语成绩(满分300)"></li></ul><input type="submit" value="提交" style ="height : 36px;border:1px;background-color:#00bee7;color:#fff;width:72px;border-radius: 3px;"></form></div><div style="height:100px;width:240px;margin:0px auto;" align="center"><p><a href="welcome_mag.html" align="center" >返回服务选择页面</a></p>
</div></body>
</html>

mysql_opt.php:

<html>
<head><title>数据库后台操作</title><meta charset="utf-8"></head><body><?php//这个页面主要是对插入进行处理function get_str($str){$val = ($_POST[$str])?$_POST[$str]:null;return $val;}$num = get_str("number");//接收学号$name = get_str("stuname");//接收姓名$class = get_str("class");//接收班级$sex = get_str("sex");//接收性别$chi = get_str("chinese");//接收语文成绩$mat = get_str("maths");//接收数学成绩$eng = get_str("english");//接收英语成绩$syn = get_str("synthesis");//接收理综成绩if($num==0 or $name ==null or $class == null or $sex ==null or $chi ==0 or $mat ==0 or $eng ==0 or $syn ==0){?><script type="text/javascript">alert("数据输入有误,请重新输入");window.location.href="insert.html";</script><?php}$sum = $chi + $mat + $eng + $syn;//计算总分$con = mysql_connect("localhost","root","root");if(!$con){?><script type="text/javascript">alert("数据库连接失败");window.location.href="insert.html";</script><?php}$sql = "insert into stu_info (id,姓名,班级,性别,语文,数学,英语,理综,总分)values($num,'$name','$class','$sex',$chi,$mat,$eng,$syn,$sum)";mysql_select_db("SGMSystem");$info = mysql_query($sql,$con);if($info){?><script type="text/javascript">alert("写入成功");window.location.href="insert.html";</script><?php}else{?><script type="text/javascript">alert("写入失败");window.location.href="insert.html";</script><?php}mysql_close($con);?></body>
</html>

delete.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>删除服务界面</title>
<style>a{text-decoration: none;font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);}a:link{color:#00FFFF;}/*未访问的颜色 蓝色*/a:hover{color:#FF00FF;}/*鼠标放上去的颜色(没起作用) 紫色*/a:visited{color:#00FFFF;}/*访问过的颜色 蓝色*/a:active{color:#FF00FF;}/*选定的代码 紫色*/</style>
</head>
<body><div style="font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);" align="center">请输入学生的学号以删除学生信息</div><div style="height:180px;width:180px;margin:0px auto;" align="right"><p sytle="text-align:center;">
<img src="宅舞.gif" width="160" height="160" align="right"/>
</p>
</div>
<div style="border:1px;border-color: #00bee7" align="center" >
<form action="delete_opt.php" method="post" style="margin: 35px auto;padding:30px;box-shadow: 1px 1px 2px 1px #aaaaaa;border-radius: 3px;width:380px;"><input type="text" name="delete" class ="" style = "background-color: rgb(250, 255, 189) !important; border-radius: 3px;box-shadow: none; color: rgb(0, 0, 0);line-height: 26px;width:200px;" placeholder="请输入要删除学生信息的学号"><input type="submit" value="删除" style ="height : 36px;border:1px;background-color:#00bee7;color:#fff;width:72px;border-radius: 3px;">
</form><div style="height:100px;width:240px;margin:0px auto;" align="center"><p><a href="welcome_mag.html" align="center" >返回服务选择页面</a></p>
</div></body>
</html>

delete_opt.php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>删除操作后台执行页面</title>
</head>
<?phpfunction get_str($str){$val = ($_POST[$str])?$_POST[$str]:null;return $val;}$number = get_str("delete");$con = mysql_connect("localhost","root","root");if(!$con){?><script type="text/javascript">alert("数据库连接失败");window.location.href="delete.html";</script><?php}$sql = "select * from stu_info where id = $number";mysql_select_db("SGMSystem");$info = mysql_query($sql,$con);$num = mysql_num_rows($info);if(!$num){?><script type="text/javascript">alert("找不到该同学,请重新输入学号");window.location.href="delete.html";</script><?php }else{//找到了该同学,进行删除操作$sql = "delete from stu_info where id = $number";$info = mysql_query($sql,$con);if($info){//删除成功?><script type="text/javascript">alert("删除成功");window.location.href="delete.html";</script><?php}else{//删除失败?><script type="text/javascript">alert("删除失败");window.location.href="delete.html";</script><?php}}
?>

select_stu.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>信息查询界面</title>
<style type = "text/css">a{text-decoration: none;font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);}a:link{color:#00FFFF;}/*未访问的颜色 蓝色*/a:hover{color:#FF00FF;}/*鼠标放上去的颜色(没起作用) 紫色*/a:visited{color:#00FFFF;}/*访问过的颜色 蓝色*/a:active{color:#FF00FF;}/*选定的代码 紫色*/
</style>
</head>
<!--这是学生端的查询界面,不提供返回管理员页面的接口-->
<body>
<div style="font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);" align="center"><p>请输入学生的学号进行查询操作</p><p>如果要查询所有学生信息请输入“所有”进行查询</p>
</div>
<div style="height:180px;width:180px;margin:0px auto;" align="right"><p sytle="text-align:center;">
<img src="宅舞.gif" width="160" height="160" align="right"/>
</p>
</div>
<form action="select_opt_stu.php" method="post" style="margin: 35px auto;padding:30px;box-shadow: 1px 1px 2px 1px #aaaaaa;border-radius: 3px;width:380px;"><input  type="text" name="check"  style = "background-color: rgb(250, 255, 189) !important; border-radius: 3px;box-shadow: none; color: rgb(0, 0, 0);line-height: 26px;width:240px;" placeholder="请输入要查询学生的学号"><input type="submit" value="查询" style ="height : 36px;border:1px;background-color:#00bee7;color:#fff;width:72px;border-radius: 3px;">
</form></body></html>

select_opt_stu.php:(和管理员端的后台页面只是返回的超链接不同)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>查询结果显示界面</title>
</head>
<style type = "text/css">a{text-decoration: none;font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);}a:link{color:#00FFFF;}/*未访问的颜色 蓝色*/a:hover{color:#FF00FF;}/*鼠标放上去的颜色(没起作用) 紫色*/a:visited{color:#00FFFF;}/*访问过的颜色 蓝色*/a:active{color:#FF00FF;}/*选定的代码 紫色*/
</style>
<body><div style="font-size:25px;font-family:微软雅黑;color:rgb(98,94,91);" align="center">查询的结果如下</div><div style="height:180px;width:180px;margin:0px auto;" align="right"><p sytle="text-align:center;">
<img src="宅舞.gif" width="160" height="160" align="right"/>
</p>
</div>
<div style="border:1px;border-color: #00bee7" align="center" >
<center><table style="border: solid 1px;border-color:#09F;" align ="center" width=60% ><tr ><td width=90px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">学号</td><td width=90px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">姓名</td><td width=90px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">班级</td><td width=60px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">性别</td><td width=60px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">语文</td><td width=60px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">英语</td><td width=60px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">数学</td><td width=60px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">理综</td><td width=60px style="font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);">总分</td></tr></div>
<?phpfunction get_str($str){$val = ($_POST[$str])?$_POST[$str]:null;return $val;}$sel = get_str("check");if($sel == null){
?><script type="text/javascript">alert("输入不能为空,请重新输入");window.location.href="select.html";</script>
<?php}$con = mysql_connect("localhost","root","root");if(!$con){?><script type="text/javascript">alert("数据库连接失败");window.location.href="select.html";</script><?php}mysql_select_db("SGMSystem");if($sel != "所有"){$sql = "select * from stu_info where id = $sel";$info = mysql_query($sql,$con);$num = mysql_num_rows($info);if($num){$row = mysql_fetch_row($info);echo $row[0].$row[1].$row[2].$row[3].$row[4].$row[5].$row[6].$row[7].$row[8];}else{?><script type="text/javascript">alert("查询失败");window.location.href="select.html";</script><?php}if($row){echo "<tr><td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[0]."</td> <td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[1]."</td> <td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[2]."</td><td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[3]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[4]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[5]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[6]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[7]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[8]."</td></tr>";}}else{$sql = "select * from stu_info";$info = mysql_query($sql,$con);$num = mysql_num_rows($info);if($num){//查询成功while($row = mysql_fetch_row($info)){//显示所有信息echo "<tr><td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[0]."</td> <td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[1]."</td> <td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[2]."</td><td width=90px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[3]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[4]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[5]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[6]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[7]."</td><td width=60px style='font-size:20px;font-family:微软雅黑;color:rgb(98,94,91);'>".$row[8]."</td></tr>";}}else{?><script type="text/javascript">alert("查询失败");window.location.href="select.html";</script><?php}}
?>
</table>
</center>
<div style="height:100px;width:240px;margin:0px auto;" align="center"><p><a href="select_stu.html"  align="center" >返回查询页面</a></p>
</div>
</body>
</html>

效果图如下:

查询信息输入页面

删除信息输入页面

插入信息输入页面

这个系统还不完美,还有很多可以改进的地方,如果有什么好的修改建议,欢迎一起讨论^_^

基于PHP和mysql的简单学生成绩管理系统相关推荐

  1. php与MYSQL制作学生成绩系统,基于PHP和mysql的简单学生成绩管理系统

    本系统主要架构图如上图所示.PS:register_check.php的自动注册代码写在check.php里了. 使用数据库的两张表,user_info用户信息表和stu_info学生成绩信息表. 提 ...

  2. 基于Servlet+jsp+mysql开发javaWeb学生成绩管理系统

    你知道的越多,你不知道的越多 点赞再看,养成习惯 如果您有疑问或者见解,或者没有积分想获取项目,欢迎指教: 企鹅:869192208 文章目录 一.开发背景 二. 需求分析 三.开发环境 四.运行效果 ...

  3. 按照学号查找学生_[源码和文档分享]基于JAVA和MYSQL数据库的学生成绩管理系统...

    一.需求分析 本系统是学生成绩管理系统,所以应该做到可以录入学生成绩,修改学生成绩,删除学生成绩,查询学生成绩,以及最后的所有学生按照GPA排名. 本系统的数据来源期末考试成绩,用来实现录入,查询,修 ...

  4. mysql 学生成绩等级_JSP+SSM+Mysql实现的学生成绩管理系统

    项目简介 本系统是基于JSP+SSM+Mysql实现的学生成绩管理系统.主要实现的功能有教师管理.学生管理.课程管理.学生成绩管理. 难度等级:中等 技术栈 编辑器 Eclipse Version: ...

  5. mysql建立学生成绩_JSP+SSM+Mysql实现的学生成绩管理系统

    项目简介 本系统是基于JSP+SSM+Mysql实现的学生成绩管理系统.主要实现的功能有教师管理.学生管理.课程管理.学生成绩管理. 难度等级:中等 技术栈 编辑器 Eclipse Version: ...

  6. C语言学生成绩简单,C语言实现简单学生成绩管理系统.pdf

    C语言实现简单学生成绩管理系统 这篇文章主要为大家详细介绍了C语言实现简单学生成绩管理系统,具有 定的参考价值,感兴趣的小伙伴们可以 参考 下 本文实例为大家分享了C语言实现学生成绩管理系统的具体代码 ...

  7. 基于jsp+mysql+ssm高校学生成绩管理系统-计算机毕业设计

    项目介绍 学生成绩管理作为一所高校对学生评价的一个标杆,它直接的体现了学生在校学习的成果.由于近年来很多学校都在扩大规模,在校学生数量甚至破万,倘若单一的采用人工记录成绩的方法明显已经显得力不从心,因 ...

  8. 基于PHP和MySQL实现的高校成绩管理系统

    源码下载 http://www.byamd.xyz/hui-zong-1/ 数据库规划 系统开发意义:高校成绩管理系统是为高校学生,老师,和工作人员提供高校成绩管理方案的一套完整系统. 1.3开发环境 ...

  9. jsp mysql servlet_JSP+Servlet+JDBC+mysql实现的学生成绩管理系统

    本系统基于JSP+Servlet+Mysql 一个基于JSP+Servlet+Jdbc的学生成绩管理系统.涉及技术少,易于理解,适合JavaWeb初学者学习使用. 难度等级:入门 技术栈 编辑器 Ec ...

最新文章

  1. 【每日DP】day13、P3147 [USACO16OPEN]262144 (区间DP,2048游戏)难度⭐⭐⭐★
  2. 谈谈微服务设计中的API网关模式
  3. eku php,WPSeku安装与使用:WordPress 安装漏洞扫描器
  4. Matlab生成m序列
  5. (49)逆向分析KiSystemService/KiFastCallEntry调用内核函数部分(SST,SSDT,SSPT)
  6. 牛客网(剑指offer) 第二十一题 栈的压入、弹出序列
  7. Exadata上oracle binary的make日志
  8. updatePanle总结
  9. php过滤危险路径,PHP技巧:php过滤危险html代码
  10. 谷歌推出3D社区“Lively” 挑战第二人生(组图)
  11. javascript边角知识
  12. 深入浅出JavaScript (四)DHTML
  13. 神经网络学习——第一个代码学习
  14. ATTck 命令执行 —— 远程动态数据交换
  15. python:命名空间学习
  16. 彻底解决Android系统A-GPS搜不到卫星的问题!亲测!
  17. lucene【转载】
  18. Android手机获取屏幕分辨率高度因虚拟导航栏带来的问题
  19. #PCIE# 8b/10b 编码
  20. 【openMP并行计算】计算π

热门文章

  1. 怎么mac ftp服务器文件夹,mac 访问 ftp服务器文件夹权限
  2. UIImagePicketView(照相机类)的使用
  3. 计算机动态图显示原理,30张传感器工作原理动态图
  4. HDU 5594(ZYB's Prime-网络流)
  5. 如何从后面截取字符串 String.slice()
  6. 前端面试--什么是防抖和节流
  7. 如何一日千里 突飞猛进?
  8. 图像处理之计算任意点与轮廓点集中距离最近的点坐标
  9. PLC信号处理系列之限幅器(Limiter)
  10. 真人电影中的幻想生物迷墙:索尼克为什么被骂到回炉重造?