📄 myinfo.asp
字号:
<!--#include file="menkan2.asp"-->
<!--#include file="conn.asp"-->
<%
action=request.QueryString("action")
set rs=server.CreateObject("adodb.recordset")
sql="select * from users where uid="&session("userid")
rs.open sql,conn,1,1
if not(rs.bof or rs.eof) then
uname=rs("uname")
utel=rs("utel")
udizhi=rs("udizhi")
uyoubian=rs("uyoubian")
uxingming=rs("uxingming")
end if
rs.close
set rs=nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="Image/Main.css" rel="stylesheet" type="text/css" />
<title>我的资料</title>
</head>
<body>
<!--#include file="top.asp"-->
<table width="760" height="14" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
<table width="760" border="1"align="center" cellpadding="3" cellspacing="1" bordercolor="#CCCCCC" style="border-collapse: collapse">
<form action="?action=save" method="post" name="user">
<tr>
<td colspan="2" align="center" bgcolor="#eeeeee">我的资料</td>
</tr>
<tr>
<td width="20%" align="center">用户名称</td>
<td><%=uname%></td>
</tr>
<tr>
<td align="center">密 码</td>
<td><input name="upassword" type="password" id="upassword"></td>
</tr>
<tr>
<td align="center">姓 名</td>
<td><input name="uxingming" type="text" id="uxingming" value="<%=uxingming%>"></td>
</tr>
<tr>
<td align="center">联系电话</td>
<td><input name="utel" type="text" id="utel" value="<%=utel%>"></td>
</tr>
<tr>
<td align="center">地 址</td>
<td><input name="udizhi" type="text" id="udizhi" value="<%=udizhi%>"></td>
</tr>
<tr>
<td align="center">邮政编码</td>
<td><input name="uyoubian" type="text" id="uyoubian" value="<%=uyoubian%>"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="修 改">
<input type="reset" name="Submit2" value="重 置"></td>
</tr>
</form>
</table>
<!--#include file="foot.asp"-->
</body>
</html>
<%
if action="save"then
upassword=request.Form("upassword")
uxingming=request.Form("uxingming")
utel=request.Form("utel")
udizhi=request.Form("udizhi")
uyoubian=request.Form("uyoubian")
if upassword="" or len(upassword)<4 or len(upassword)>20 then
response.write "<SCRIPT language=JavaScript>alert('请输入密码,且不得小于4大于20个字!');"
response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if
if uxingming="" then
response.write "<SCRIPT language=JavaScript>alert('请输入姓名!');"
response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if
if utel="" then
response.write "<SCRIPT language=JavaScript>alert('请输入联系电话!');"
response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if
if udizhi="" then
response.write "<SCRIPT language=JavaScript>alert('请输入地址!');"
response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if
if uyoubian="" then
response.write "<SCRIPT language=JavaScript>alert('请输入邮政编码!');"
response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from users where uid="&session("userid")
rs.open sql,conn,1,3
if not(rs.bof or rs.eof)then
rs("upassword")=upassword
rs("uxingming")=uxingming
rs("utel")=utel
rs("udizhi")=udizhi
rs("uyoubian")=uyoubian
rs.update
end if
rs.close
set rs=nothing
response.Write"<script>alert('修改完成!');location.href('?');</script>"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -