基于php+mysql的期末作业小项目(学生信息管理系统)

 更新时间:2023年01月10日 09:21:27   作者:itxbfeng  
最近自己写的一个简单的php期末作业项目,分享给大家,下面这篇文章主要给大家介绍了关于基于php+mysql的期末作业小项目,一个学生信息管理系统,需要的朋友可以参考下

前言

一个简单的php➕mysql项目学生信息管理系统,用于广大学子完成期末作业的参考,该系统实现增、删、改、查等基本功能。

1、登录界面

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
	<link rel="stylesheet" type="text/css" href="login.css" rel="external nofollow" >
</head>
 
<body>
<div class="login">	
	<h2 class="BT">Login</h2>
	<div class="zm">
<form action="function.php?action=login" method="post">
账号:<input type="number"  name="user">


密码:<input type="password"  name="password">
<p>没有账号?点击<a href="newuser.php" rel="external nofollow" >注册</a></p>
<div>
<input type="submit" value="登录"  class="dl"><input type="reset" value="重置" class="cz">	
</div>
</form>
</div>
</div>
</body>
</html>

当输入密码点击登录后会弹出“登录成功”或者“账号或密码有错误提示”

405bb6343d104dcfaeb62c64a50223ce.png

2、注册界面

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="newuser.css" rel="external nofollow" >	
</head>
 
<body>
	<div class="l">
<img src="微信图片_20220530195333333png.png" width="100px"  height="100px">
<h3>学生成绩管理系统</h3>
	
</div>
	<div style=" height: 130px;  " > <a href="login.php" rel="external nofollow"  class="ll"  ></a></div>
<div class="zc" style="padding-left: 30px;">
	<h2 align="center" style="color:#D6CFCF;">DeleteStudent</h2>

<form method="post" action="">
账       号:<input type="number" class="id" name="id">	

密       码:<input type="password" class="password" name="password">

确认密码:<input type="password" class="repassword" name="repassword">

	<input type="submit" class="tj" value="注册" name="tj">
	</form>	
	</div>
	<?php
	include("connection.php");
	if(isset($_POST["tj"])){
		$id=$_POST["id"];
		$password=$_POST["password"];
		$repassword=$_POST["repassword"];
		if($password==$repassword){
		connection();
		$sql="insert into user(userid,password)values('".$id."','".$password."')";	
		$result=mysql_query($sql);
			echo "<script>alert('注册成功!');location='login.php'</script>";
		}else{
			echo "<script>alert('密码不一致');location='newuser.php'</script>";
			
		}
	}
	?>
</body>
</html>

当输入密码点击注册后会弹出“注册成功”或者“密码不一致”或者账号密码不为空提示·

62de339651d142649171ebdd8eb71b11.png

点击图上的小房子可以返回登录界面 

3、主界面

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
 
<body>
<div class="l">
<img src="微信图片_20220530195333333png.png" width="100px"  height="100px" >
<h3>学生信息管理系统</h3>
</div>
	<div style=" height: 130px; "> <a href="login.php" class="ll"  ></a></div>
	<h3  style="padding-left: 48%;padding-top: 0px; color: aquamarine; height: 30px;line-height: 29px;"><a href="table.php" style="text-decoration: none; color: aqua;" class="a3">学生表</a></h3>
	<div class="nav">
		
        <a href="select.php" class="bg1">查询学生信息</a>
        <a href="update.php" class="bg2">修改学生信息</a>
        <a href="delete.php"class="bg3" >删除学生信息</a>
        <a href="adding.php"class="bg4">添加学生信息</a>
    
    </div>
</body>
</html>

4、学生表界面

点击主界面上的“学生表”可以进入学生表界面

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="table.css">	
		
</head>
<body>
<div class="l" ">
<img src="微信图片_20220530195333333png.png" width="100px"  height="100px" >
<h3>学生信息管理系统</h3>
	
</div>
<div style=" height: 130px; "> <a href="main.php" class="ll"  ></a></div>																	  
<h2 align="center" >学生表</h2><br>
	<table align="center" border="1" cellpadding="0 " cellspacing="0" width="700" style="margin: 0px auto;">
	<tr align="center"  height="30px">
		<td>姓名</td>
		<td>性别</td>
		<td>年龄</td>
		<td>学号</td>
		<td>联系方式</td>
	</tr>
	
	<?PHP
	include("connection.php");
	connection();
	$sql="select * from studenttable ";
mysql_query("SET CHARACTER SET utf-8");
    $result=mysql_query($sql);
	while($row=mysql_fetch_assoc($result)){
		echo("<tr align='center' height='30px'>");
		echo("<td>".$row['Name']."</td>");
		echo("<td>".$row['Sex']."</td>");
		echo("<td>{$row['Age']}</td>");
		echo("<td>{$row['Sno']}</td>");
		echo("<td>{$row['TelphoneNumber']}</td>");
 
   echo("</tr>");
		}
	?>
	</table>
</body>
</html>

点击图上的小房子可以返回主界面 

5 、查询学生界面

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
	<link rel="stylesheet" type="text/css" href="select.css">	
</head>
 
<body>
		<div class="l">
<img src="微信图片_20220530195333333png.png" width="100px"  height="100px">
<h3>学生成绩管理系统</h3>
	
</div>
	<div style=" height: 130px; "> <a href="main.php" class="ll"  ></a></div>
	<div class="zc" style="padding-left: 30px;">
	<h2 align="center" style="color:#D6CFCF;">SelectStudent</h2><br>
<form method="post" action="">
学&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:<input type="number" class="name" name="sno">	<br><br>
	<input type="submit" class="tj" value="查询" name="cx" >
	</form>	
	</div>
	<table align="center" border="1" cellpadding="0 " cellspacing="0" width="700" style="margin: 0px auto;">
	<tr align="center"  height="30px">
		<td>姓名</td>
		<td>性别</td>
		<td>年龄</td>
		<td>学号</td>
		<td>联系方式</td>
	</tr>
	
	<?PHP
	include("connection.php");
	
	connection();
		if(isset($_POST["cx"])){
		$Sno=$_POST["sno"];
	$sql=$sql="select * from studenttable where Sno='".$Sno."'";
mysql_query("SET CHARACTER SET utf-8");
    $result=mysql_query($sql);
			if(mysql_num_rows($result)>0)
	{
		echo "<script>alert('查询成功!');</script>";
	}else{
				
		echo "<script>alert('学号不存在!');</script>";		
				
			}
				
	while($row=mysql_fetch_assoc($result)){
		echo("<tr align='center' height='30px'>");
		echo("<td>".$row['Name']."</td>");
		echo("<td>".$row['Sex']."</td>");
		echo("<td>{$row['Age']}</td>");
		echo("<td>{$row['Sno']}</td>");
		echo("<td>{$row['TelphoneNumber']}</td>");
 
   echo("</tr>");}
			
    }               
?>
	</table>
</body>
</html>

点击图上的小房子可以返回主界面 

6、修改学生信息界面

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
	<link rel="stylesheet" type="text/css" href="update.css">	
</head>
 
<body>
	<div class="l">
<img src="微信图片_20220530195333333png.png" width="100px"  height="100px">
<h3>学生成绩管理系统</h3>
	
</div>
	<div style=" height: 130px;  " > <a href="main.php" class="ll"  ></a></div>
<div class="zc" style="padding-left: 30px;">
	<h2 align="center" style="color:#D6CFCF;">UpdateStudent</h2><br>
<form method="post" action="">
姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:<input type="text" class="name" name="name">	<br><br>学&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:<input type="number" class="sno" name="sno"><br><br>
性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别:<input type="radio" class="sex" name="sex" value="男" checked>男<input type="radio" class="sex" name="sex" value="女">女	<br><br>
年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;龄:<input type="number" class="age" name="age"><br><br>
联系方式:&nbsp;&nbsp;<input type="tel" class="telphone" name="telphone"><br>
	<input type="submit" class="tj" value="修改" name="tj">
	</form>	
	</div>
	<?php
	include("connection.php");
	if(isset($_POST["tj"])){
		$Name=$_POST["name"];
		$Sno=$_POST["sno"];
		connection();
		$sql="select * from studenttable where Name='".$Name."' and Sno='".$Sno."'";	
		$result=mysql_query($sql);
		if(mysql_num_rows($result)>0){
			$Name=$_POST["name"];
		$Sno=$_POST["sno"];
			$Sex=$_POST["sex"];
			$Age=$_POST["age"];
			$tel=$_POST["telphone"];
			$sql="update studenttable set Sex='".$Sex."',Age='".$Age."',TelphoneNumber='".$tel."'where Sno='".$Sno."' and Name='".$Name."'";
			mysql_query($sql)or die(mysql_error());
				echo("<script>alert('修改成功');window.location.href='table.php';</script>");
				
			}
			else{
				
				echo("<script>alert('学号或姓名不存在');</script>");
				
			}
	}
		
	?>
</body>
</html>

点击图上的小房子可以返回主界面 

7、删除学生信息界面

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
	<link rel="stylesheet" type="text/css" href="delete.css">
	
</head>
 
<body>
	<div class="l">
<img src="微信图片_20220530195333333png.png" width="100px"  height="100px">
<h3>学生成绩管理系统</h3>
	
</div>
	<div style=" height: 130px;  " > <a href="main.php" class="ll"  ></a></div>
<div class="zc" style="padding-left: 30px;">
	<h2 align="center" style="color:#D6CFCF;">DeleteStudent</h2><br>
<form method="post" action="">
姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:<input type="text" class="name" name="name">	<br><br>学&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:<input type="number" class="sno" name="sno"><br><br>
	<input type="submit" class="tj" value="删除" name="tj">
	</form>	
	</div>
	<?php
	include("connection.php");
	if(isset($_POST["tj"])){
		$Name=$_POST["name"];
		$Sno=$_POST["sno"];
		connection();
		$sql="select * from studenttable where Name='".$Name."' and Sno='".$Sno."'";	
		$result=mysql_query($sql);
		if(mysql_num_rows($result)>0){
			$Name=$_POST["name"];
		$Sno=$_POST["sno"];
			$sql="delete from  studenttable where Sno='".$Sno."' and Name='".$Name."'";
			mysql_query($sql)or die(mysql_error());
				echo("<script>alert('删除成功');window.location.href='table.php';</script>");
				
			}
			else{
				
				echo("<script>alert('学号或姓名不存在');</script>");
				
			}
	}
		
	?>
</body>
</html>

点击图上的小房子可以返回主界面 

8、添加学生信息界面

 点击图上的小房子可以返回主界面 

9、后台数据库

4e40a46ab92342ada91bcf239e9ffe01.png

总结

到此这篇关于基于php+mysql的期末作业小项目的文章就介绍到这了,更多相关php mysql学生信息管理系统内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

相关文章

  • php中sql注入漏洞示例 sql注入漏洞修复

    php中sql注入漏洞示例 sql注入漏洞修复

    这篇文章主要介绍了php中sql注入漏洞示例,大家在开发中一定要注意
    2014-01-01
  • thinkPHP实现将excel导入到数据库中的方法

    thinkPHP实现将excel导入到数据库中的方法

    这篇文章主要介绍了thinkPHP实现将excel导入到数据库中的方法,涉及thinkPHP结合PHPExcel插件操作excel与数据库的相关技巧,需要的朋友可以参考下
    2016-04-04
  • ThinkPHP5&5.1框架关联模型分页操作示例

    ThinkPHP5&5.1框架关联模型分页操作示例

    这篇文章主要介绍了ThinkPHP5&5.1框架关联模型分页操作,结合实例形式分析了thinkPHP5、5.1关联模型的建立、控制器、模型的实现及分页操作相关技巧,需要的朋友可以参考下
    2019-08-08
  • php记录搜索引擎爬行记录的实现代码

    php记录搜索引擎爬行记录的实现代码

    这篇文章主要介绍了php记录搜索引擎爬行记录的实现代码,然后在文中给大家补充介绍了php获取各搜索蜘蛛爬行记录的代码,需要的朋友可以参考下
    2018-03-03
  • PHP中Fatal error session_start()错误解决步骤

    PHP中Fatal error session_start()错误解决步骤

    这篇文章主要介绍了PHP中Fatal error session_start()错误解决步骤,着重于错误的排除步骤,一步一步排查下去,肯定可以解决这个错误,需要的朋友可以参考下
    2014-08-08
  • codeigniter自带数据库类使用方法说明

    codeigniter自带数据库类使用方法说明

    在 CodeIgniter 中,使用数据库是非常频繁的事情。你可以使用框架自带的数据库类,就能便捷地进行数据库操作
    2014-03-03
  • 分享个简单易懂且非常有用的laravel事件

    分享个简单易懂且非常有用的laravel事件

    这篇文章主要给大家介绍了一个简单易懂并且非常有用的laravel事件,文中通过实例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面跟着小编来一起学习学习吧。
    2017-08-08
  • 详解Laravel服务容器的绑定与解析

    详解Laravel服务容器的绑定与解析

    本篇文章给大家带来的内容是关于Laravel服务容器的绑定与解析,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助
    2019-11-11
  • PHP实现简单网站访客统计的方法实例

    PHP实现简单网站访客统计的方法实例

    这篇文章主要给大家介绍了关于PHP实现简单网站访客统计的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2021-01-01
  • Laravel find in set排序实例

    Laravel find in set排序实例

    今天小编就为大家分享一篇Laravel find in set排序实例,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
    2019-10-10

最新评论