宿舍查寝系统(一)

宿舍查寝系统


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>
</head>

<body bgcolor="#FFCC99">
<h1 align="center">宿舍管理系统</h1>
<h3 align="center"><a href="cqgl.html">查寝管理</a>&nbsp;&nbsp;&nbsp;卫生检查&nbsp;&nbsp;&nbsp;宿舍文化&nbsp;&nbsp;&nbsp;材料领取&nbsp;&nbsp;&nbsp;最新动态</h3>
</body>
</html>

这里写图片描述

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>
</head>

<body>
<form enctype="multipart/form-data" method="post" action="cqgl.php">
<table align="center" width="400">
<tr>
<td colspan="2" align="center">查寝管理系统</td>
</tr>
<tr>
<td align="right">宿舍号:</td>
<td align="center"><input type="text" name="ssh" /></td></tr>
<tr>
<td align="right">姓名:</td>
<td align="center"><input type="text" name="name" /></td></tr>
<tr>
<td align="right">床号:</td>
<td align="center"><input type="text" name="ch" /></td></tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="cr" value="插入" /></td></tr>
</table>

</form>
</body>
</html>

这里写图片描述

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>

<body>
<?php
//载入数据库
include("mysql.php");
//获取输入内容
$ssh=$_POST['ssh'];
$name=$_POST['name'];
$ch=$_POST['ch'];
//插入数据
$crsj="insert into chaqin values('$ssh','$name','$ch')";
$pd=mysql_query($crsj);
//判断
if($pd){
    echo "插入成功!";}else{
        echo "插入失败!";}
?>
</body>
</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>
</head>

<body>
<?php
//连接数据库
mysql_connect("localhost","root","") or die("连接失败");
//设置编码格式
mysql_query("set names utf-8");
//选择数据库
mysql_query("use sushe") or die("选择失败");

?>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/qq_40477146/article/details/80539063