📄 index.php
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>基于WEB的Linux用户管理系统</title>
</head>
<body bgcolor="#CCCCCC">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="19">
<div align="center"><font color="#0000FF" size="4"><strong>基于WEB的Linux用户管理系统</strong></font></div></td>
</tr>
<tr>
<td>
<form action="add.php" method="post">
<div align="right">用户名:
<input type=text name='name' size=10 style="background-color:#ffffff; color:#336699;, border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''">
密码:
<input type=password name='password1' size=10 style="background-color:#ffffff; color:#336699; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''">
密码重复:
<input type=password name='password2' size=10 style="background-color:#ffffff; color:#336699; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''">
<input type="submit" value="添加">
</div>
</form>
</td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center">用户名</div></td>
<td><div align="center">创建时间</div></td>
<td><div align="center">目前状态</div></td>
<td><div align="center">操作</div></td>
</tr>
<?php
include('connect_db.php');
//从数据库里读出用户信息
$str_sql="select * from usertable order by id desc";
if(!$result=mysql_query($str_sql))
{
echo "执行语句出错";
exit();
}
while($row=mysql_fetch_object($result))
{
echo "<tr align=\"center\">\n";
echo '<td>',$row->name,'</td>';
echo '<td>',$row->time,'</td>';
echo '<td>';
switch($row->state)
{
case -1 : echo '待删除';break;
case 0 : echo '待添加';break;
case 1 : echo '已添加';break;
}
echo '</td>';
echo '<td>','<a href=del.php?id=',$row->id,'>删除</a>','</td>';
}
?>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -