具体代码如下:
<!--#include file="lianjie.asp"-->
<html>
<style type="text/css">
<!--
.STYLE1 {
font-size: 24px;
font-weight: bold;
}
.STYLE2 {
font-size: 18px;
font-weight: bold;
}
.STYLE3 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
<body>
<% response.buffer=true %>
<table width="1024" align="center">
<tr>
<td height="120" colspan="2" background="image/1.1.gif"> </td>
</tr>
<tr>
<td width="180" height="500" background="image/2.2.gif"><table width="180" height="177">
<tr>
<td height="76" align="center" valign="top"><a href="sinf.asp"><img src="image/4.gif" width="145" height="62" border="0" /></a></td>
</tr>
<tr>
<td height="93" align="center" valign="bottom"><a href="smm.asp"><img src="image/3.gif" width="143" height="63" border="0" /></a></td>
</tr>
</table></td>
<td width="832" height="500" bgcolor="#FFFFFF"><table width="832">
<form name="gm" method="post" action="">
<table width="500" border="1" align="center">
<tr>
<td bgcolor="#3366ff"><div align="center" class="STYLE1">修改密码</div></td>
</tr>
<tr>
<table width="500" align="center">
<tr>
<td>原密码</td>
<td><input type="text" name="password" size="20"></td>
</tr>
<tr>
<td>新密码</td>
<td><input type="text" name="npassword" size="20"></td>
</tr>
<tr>
<td align="center" ><input type="submit" name="btnsubmit" value="修改">
</tr>
</table>
</table>
</form>
</table></td>
<%
dim password,mm,spassword,smm,snpassword,npassword
smm=session("smm")
mm=cstr(smm)
spassword=request.form("password")
snpassword=request.form("npassword")
password=cstr(spassword)
npassword=cstr(snpassword)
'response.Write npassword&"nim"&mm
if password=mm then
dim strsql,num,rs,snum
snum=session("num")
num=cstr(snum)
strsql="update slogin set password='"&npassword&"'where num=‘"&num&"'"
conn.execute(strsql)
response.write rs("password")
session("smm")=rs("password")
response.write "修改密码成功"
else response.write "您输入的密码不正确,请重新输入!"
end if
%></tr>
</table>
</body>
<!--#include file="lianjie.asp"-->
<html>
<style type="text/css">
<!--
.STYLE1 {
font-size: 24px;
font-weight: bold;
}
.STYLE2 {
font-size: 18px;
font-weight: bold;
}
.STYLE3 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
<body>
<% response.buffer=true %>
<table width="1024" align="center">
<tr>
<td height="120" colspan="2" background="image/1.1.gif"> </td>
</tr>
<tr>
<td width="180" height="500" background="image/2.2.gif"><table width="180" height="177">
<tr>
<td height="76" align="center" valign="top"><a href="sinf.asp"><img src="image/4.gif" width="145" height="62" border="0" /></a></td>
</tr>
<tr>
<td height="93" align="center" valign="bottom"><a href="smm.asp"><img src="image/3.gif" width="143" height="63" border="0" /></a></td>
</tr>
</table></td>
<td width="832" height="500" bgcolor="#FFFFFF"><table width="832">
<form name="gm" method="post" action="">
<table width="500" border="1" align="center">
<tr>
<td bgcolor="#3366ff"><div align="center" class="STYLE1">修改密码</div></td>
</tr>
<tr>
<table width="500" align="center">
<tr>
<td>原密码</td>
<td><input type="text" name="password" size="20"></td>
</tr>
<tr>
<td>新密码</td>
<td><input type="text" name="npassword" size="20"></td>
</tr>
<tr>
<td align="center" ><input type="submit" name="btnsubmit" value="修改">
</tr>
</table>
</table>
</form>
</table></td>
<%
dim password,mm,spassword,smm,snpassword,npassword
smm=session("smm")
mm=cstr(smm)
spassword=request.form("password")
snpassword=request.form("npassword")
password=cstr(spassword)
npassword=cstr(snpassword)
'response.Write npassword&"nim"&mm
if password=mm then
dim strsql,num,rs,snum
snum=session("num")
num=cstr(snum)
strsql="update slogin set password='"&npassword&"'where num=‘"&num&"'"
conn.execute(strsql)
response.write rs("password")
session("smm")=rs("password")
response.write "修改密码成功"
else response.write "您输入的密码不正确,请重新输入!"
end if
%></tr>
</table>
</body>
解决方案 »
- 求解ASP用customvalidator定义密码没反应
- javascript实现复写
- 询问一个JAVA的小问题
- 在asp.net中二进制图片显示?
- 前几天看到一个blog上有用ajax实现的datagrid新增修改删除,忘了地址了,麻烦知道的朋友说下!
- 生成缩略图的问题
- 在一个表中求和,如果求和记录为空的话,系统提示错误。请问如何处理吧
- 拍案惊奇:在 Asp.net 中比如一个页面类(基类 page )设计为abstract ,页面一样可以生成,
- Duwamish7.0的Web.Config
- 预约系统,出现多人同时预约,会出现同个时间点被多个人预约成功吗
- 新手求解???
- .net mvc 3中如何实现更改密码时,原密码的验证?
<!--#include file="lianjie.asp"-->
<%
dim password,mm,spassword,smm,snpassword,npassword
smm=session("smm")
mm=cstr(smm)
spassword=request.form("password")
snpassword=request.form("npassword")
password=cstr(spassword)
npassword=cstr(snpassword)
'response.Write npassword&"nim"&mm
if password=mm then
dim strsql,num,rs,snum
snum=session("num")
num=cstr(snum)
strsql="update slogin set password='"&npassword&"'where num=‘"&num&"'"
conn.execute(strsql)
response.write rs("password")
session("smm")=rs("password")
response.write "修改密码成功"
else response.write "您输入的密码不正确,请重新输入!"
end if
%>
strsql="update slogin set password='"&npassword&"' where num=‘"&num&"'"然后在conn.execute(strsql)处设置一个断点, 看看strsql的具体内容是什么? 是不是sql的语法有错误
只要用conn.execute(strsql)就出错!
update slogin set password='b' where num=‘a'把这句
strsql="update slogin set password='"&npassword&"'where num=‘"&num&"'"
换成
strsql="update slogin set password='"&npassword&"'where num='"&num&"'"
看看行不行