📄 update.asp
字号:
<html>
<head>
<title>资料修改成功</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<BODY vLink=#333333 aLink=#333333 link=#333333 bgColor=#ffffff leftMargin=0
topMargin=0><LINK href="forum.css" type=text/css
rel=stylesheet>
<TABLE cellSpacing=0 cellPadding=1 width="95%" align=center bgColor=#777777
border=0>
<TBODY>
<TR>
<TD>
<TABLE style="COLOR: #000000" cellSpacing=0 cellPadding=4 width="100%"
border=0 bgcolor="#a9d46d">
<TBODY>
<tr>
<td width="27%" height="2"><font color="#FF0000">>></font>欢迎您,<b><%if session("loginname")="" then %>请先登录!<%end if%><%=session("loginname")%></b></td>
<td width="62%" height="2"><img src="images/reg.gif" width="16" height="16" align="absmiddle"><a href="reg.asp">用户注册</a>|<img src="images/login.gif" width="16" height="16"><a href="login.asp">用户登录</a>|<img src="images/update.gif" width="16" height="16"><a href="usermodify.asp">修改资料</a>|<img src="images/message.gif" width="21" height="14">现在时间:<%=now()%></td>
<td width="11%" height="2">
<div align="right"><img src="images/home.gif" width="14" height="14" align="absmiddle">返回首页</div>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<!--#include file="updatebody.asp"-->
<%
'密码转换函数
Function encryptpwd(passwd)
dim leghth, i, newpasswd
dim temp
dim head, tail
passwd=left(passwd,10)
length=len(passwd)
newpasswd=""
for i=1 to length
temp=mid(passwd,i,1)
temp=asc(temp)
head=temp mod 16
tail=temp\16
temp=(head*16)+tail
if cint(temp)<100 and cint(temp)>10 then
temp="0"&temp
else
if cint(temp)<10 then
temp="00"&temp
end if
end if
newpasswd=newpasswd&temp
next
encryptpwd=newpasswd
end function
'将数据中的单引号转化为双引号,并且在前面加单引号
Function Sqlstr(data)
sqlstr=Replace(data,"'","''")
End Function
%>
<%
username=session("loginname")
passwd=encryptpwd(Request.Form("psw"))
sex=Request.Form("SEX")
face=Request.Form("face")
oicq=Request.Form("oicq")
page=sqlstr(trim(Request.Form("homepage")))
email=sqlstr(trim(Request.Form("email")))
IP = Request.ServerVariables("REMOTE_ADDR")
address=sqlstr(trim(request.form("address")))
session("loginname")=username
session("password")=request.form("psw")
Dim conn
Set conn=Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="& Server.MapPath("db\rainolt.mdb")
sql="update user set psw='"&passwd&"',email='"&email&"',oicq='"&oicq&"',face='"&face&"',sex='"&sex&"',page='"&page&"',ip='"&ip&"',address='"&address&"' where username='"&username&"'"
conn.Execute(sql)
conn.close
%>
<table width="70%" border="0" align="center" bgcolor="#777777" cellpadding="1" cellspacing="1">
<tr bgcolor="#a9d46d">
<td colspan="2" height="20">
<div align="center"><b>修改成功</b></div>
</td>
</tr>
<tr bgcolor="#f4faed">
<td colspan="2">姓名:<img src="images\<%=face%>.bmp"><font color="#FF0000"><%=username%></font></td>
</tr>
<tr bgcolor="#f4faed">
<td width="50%">密码:<%=request.form("psw")%></td>
<td width="50%">来自:<%=address%></td>
</tr>
<tr bgcolor="#f4faed">
<td width="50%">性别:<%=sex%></td>
<td width="50%">IP地址:<%=ip%></td>
</tr>
<tr bgcolor="#f4faed">
<td width="50%">Email:<%=email%></td>
<td width="50%">OICQ:<%=oicq%></td>
</tr>
<tr>
<td colspan="2" bgcolor="#f4faed">Homepage:<%=page%></td>
</tr>
<tr>
<td colspan="2" bgcolor="#a9d46d" height="20">
<div align="center"><a href='index.asp'>返回论坛</a></div>
</td>
</tr>
</table>
<!--#include file="footer.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -