文章詳情頁
基于php+mysql的期末作業小項目(學生信息管理系統)
瀏覽:186日期:2022-06-06 18:53:35
目錄
- 前言
- 1、登錄界面
- 2、注冊界面
- 3、主界面
- 4、學生表界面
- 5 、查詢學生界面
- 6、修改學生信息界面
- 7、刪除學生信息界面
- 8、添加學生信息界面
- 9、后臺數據庫
- 總結
前言
一個簡單的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> <h2>Login</h2> <div><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="登錄" ><input type="reset" value="重置"> </div></form></div></div></body></html>
當輸入密碼點擊登錄后會彈出“登錄成功”或者“賬號或密碼有錯誤提示”
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><img src="微信圖片_20220530195333333png.png" width="100px" height="100px"><h3>學生成績管理系統</h3> </div> <div > <a href="login.php" rel="external nofollow" ></a></div><div> <h2 align="center">DeleteStudent</h2><form method="post" action="">賬 號:<input type="number" name="id"> 密 碼:<input type="password" name="password">確認密碼:<input type="password" name="repassword"> <input type="submit" 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>
當輸入密碼點擊注冊后會彈出“注冊成功”或者“密碼不一致”或者賬號密碼不為空提示·
點擊圖上的小房子可以返回登錄界面
3、主界面
<!doctype html><html><head><meta charset="utf-8"><title>無標題文檔</title><link rel="stylesheet" type="text/css" href="main.css"></head> <body><div><img src="微信圖片_20220530195333333png.png" width="100px" height="100px" ><h3>學生信息管理系統</h3></div> <div> <a href="login.php" ></a></div> <h3 ><a href="table.php">學生表</a></h3> <div> <a href="select.php">查詢學生信息</a><a href="update.php">修改學生信息</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 "><img src="微信圖片_20220530195333333png.png" width="100px" height="100px" ><h3>學生信息管理系統</h3> </div><div> <a href="main.php" ></a></div> <h2 align="center" >學生表</h2><br> <table align="center" border="1" cellpadding="0 " cellspacing="0" width="700"> <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><img src="微信圖片_20220530195333333png.png" width="100px" height="100px"><h3>學生成績管理系統</h3> </div> <div> <a href="main.php" ></a></div> <div> <h2 align="center">SelectStudent</h2><br><form method="post" action="">學 號:<input type="number" name="sno"> <br><br> <input type="submit" value="查詢" name="cx" > </form> </div> <table align="center" border="1" cellpadding="0 " cellspacing="0" width="700"> <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><img src="微信圖片_20220530195333333png.png" width="100px" height="100px"><h3>學生成績管理系統</h3> </div> <div > <a href="main.php" ></a></div><div> <h2 align="center">UpdateStudent</h2><br><form method="post" action="">姓 名:<input type="text" name="name"> <br><br>學 號:<input type="number" name="sno"><br><br>性 別:<input type="radio" name="sex" value="男" checked>男<input type="radio" name="sex" value="女">女 <br><br>年 齡:<input type="number" name="age"><br><br>聯系方式: <input type="tel" name="telphone"><br> <input type="submit" 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><img src="微信圖片_20220530195333333png.png" width="100px" height="100px"><h3>學生成績管理系統</h3> </div> <div > <a href="main.php" ></a></div><div> <h2 align="center">DeleteStudent</h2><br><form method="post" action="">姓 名:<input type="text" name="name"> <br><br>學 號:<input type="number" name="sno"><br><br> <input type="submit" 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、后臺數據庫
總結
到此這篇關于基于php+mysql的期末作業小項目的文章就介紹到這了,更多相關php mysql學生信息管理系統內容請搜索以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持!
標簽:
PHP
排行榜