📄 studentreg.asp
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>学生注册页面</title>
<style type="text/css">
<!--
body,td,th {
font-size: 14px;
color: #003399;
}
.style2 {
font-family: "华文行楷";
font-weight: bold;
font-size: 24px;
}
a:link {
color: #003399;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #003399;
}
a:hover {
text-decoration: none;
color: #003399;
}
a:active {
text-decoration: none;
color: #003399;
}
-->
</style></head>
<body>
<!--#include virtual="../inc/head.htm"-->
<p></p>
<form method="post" action="">
<table width="35%" border="0" align="center">
<tr>
<td colspan="2"><div align="center" class="style2">学生注册</div></td>
</tr>
<tr>
<td width="33%">用户名:</td>
<td width="67%"><input type="text" name="student" size="20"></td>
</tr>
<tr>
<td>密码:</td>
<td><input type="password" name="pass1" size="20"></td>
</tr>
<tr>
<td>确认密码:</td>
<td><input type="password" name="pass2" size="20"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="下一步" name="st"><input type="reset" name="rt" value="重置"></td>
</tr>
</table>
</form>
<p></p>
<%
if Request.Form("st")<>"" then
student=Request.Form("student")
pass1=Request.Form("pass1")
pass2=Request.Form("pass2")
if student="" then
Response.Write("用户名不得为空!")
elseif pass1<>pass2 then
Response.Write("两次输入的密码不同,请重新输入!")
else
Set conn=Server.CreateObject("ADODB.Connection")
conn.Open "Dbq=" & Server.Mappath("db/info.mdb") & ";Driver={Microsoft Access Driver (*.mdb)}"
strSql="select * from studentreg where snick='" & student & "'"
Set rs=conn.Execute(strSql)
if Not rs.EOF then
Response.Write("该用户名已经存在!")
else
strSql="insert into studentreg(snick,spass) values('" & student & "','" & pass1 & "')"
conn.Execute(strSql)
session("student")=student
Response.Redirect("studentdetailreg.asp")
end if
end if
end if
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -