📄 mima.asp
字号:
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<%
sno=session("idstr")
dim conn,connstr
connstr="Driver={sql server};UID=sa;PWD=sa;database=zikao;server=BILLGATES"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from stulog where stuid= '"&sno&"'"
rs.open sql,conn,3
%>
<body>
<table border="1" width="333" height="361">
<tr>
<td height="43" width="323" colspan="2"> </td>
</tr>
<form action="mima.asp" method="post">
<tr>
<td height="33" width="115">
<p align="right">旧密码</td>
<td height="33" width="202"><input type="text" name="T1" size="20"></td>
</tr>
<tr>
<td height="33" width="115">
<p align="right">新密码</td>
<td height="33" width="202"><input type="text" name="T2" size="20"></td>
</tr>
<tr>
<td height="39" width="115">再次输入新密码</td>
<td height="39" width="202"><input type="text" name="T3" size="20"></td>
</tr>
<tr>
<td height="113" width="323" colspan="2">
<p align="center"><input type="reset" value="重置" name="B2">
<input type="submit" value="提交" name="B1"></td>
</tr>
</form>
<tr>
<td height="73" width="323" colspan="2">
<%
rs.close
if request.form("B1")="提交" then
sno=session("idstr")
sql1="select * from stulog where stuid='"&sno&"' and stupass='"&request.form("T1")&"'"
rs.open sql1,conn
if rs.eof then
response.write"旧密码错误!"
else
pass1=request.form("T2")
pass2=request.form("T3")
if pass1<>pass2 then
response.write"新密码不一致!"
else
set rs1=Server.CreateObject("ADODB.Recordset")
sql2="update stulog set stupass= '"&pass1&"' where stuid= '"&sno&"'"
rs1.open sql2,conn
response.write"密码修改成功!"
end if
end if
end if
%>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -