?? 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 + -