📄 showuser.asp
字号:
<!--#include file="conn.asp" -->
<% dim adminname
adminname=session("admin")
if session("flag")<>2 then
response.write "<script>alert('对不起!你不是高级管理员!');window.close();</script>"
response.end
end if
if request("userid")="" then
response.write "<script>alert('对不起!你还没选择要查看的用户!');window.close();</script>"
response.end
end if
Set rs= Server.CreateObject("ADODB.Recordset")
%>
<html>
<head>
<title>编辑系统用户资料页</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="forum.css" type="text/css">
<script language="JavaScript">
<!--
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000" alink="#FF0000" leftmargin="0" topmargin="0">
<%
if request("edituser")="save" then
call chkinfo()
else
call edituser()
end if
sub edituser()
sql="select * from [user] where userid="&request("userid")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<div align=center>你要查看的用户不存在!</div>"
else
%>
<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#6699FF">
<tr>
<td bgcolor="#99CCFF" height="30"> <div align="center"><b>编辑系统用户资料页</b></div></td>
</tr>
<tr>
<td bgcolor="#FFCC00"> <div align="center"><font color="#FF0000"><b><%=adminname%></b></font>在查询<font color="#FF0000"><b><%=rs("nickname")%></b></font>的个人资料</div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="3">
<form name="form1" method="post" action="showuser.asp?edituser=save&userid=<%=rs("userid")%>">
<tr>
<td width="41%" align="right">用户昵称:</td>
<td width="59%"> <input name="nickname" type="text" class="buttonface" id="nickname" value="<%=rs("nickname")%>" size="20">
</td>
</tr>
<tr>
<td width="41%" align="right">真实姓名:</td>
<td width="59%"> <input name="username" type="text" class="buttonface" id="username" value="<%=rs("username")%>" size="20">
</td>
</tr>
<tr>
<td width="41%" align="right">性别:</td>
<td width="59%"><% if rs("sex")=true then %>
男 <% else %>
女 <% end if %></td>
</tr>
<tr>
<td width="41%" align="right">登陆密码:</td>
<td width="59%"> <input name="passwd" type="text" class="buttonface" id="passwd" value="<%=rs("passwd")%>" size="20"></td>
</tr>
<tr>
<td width="41%" align="right">生日:</td>
<td width="59%"><%=rs("shengri")%></td>
</tr>
<tr>
<td width="41%" align="right">OICQ:</td>
<td width="59%"><%=rs("oicq")%></td>
</tr>
<tr>
<td width="41%" align="right">EMAIL:</td>
<td width="59%"><a href="mailto:<%=rs("email")%>" target="_blank"><%=rs("email")%></a></td>
</tr>
<tr>
<td width="41%" align="right">个人主页:</td>
<td width="59%"><a href="<%=rs("url")%>" target="_blank"><%=rs("url")%></a></td>
</tr>
<tr>
<td width="41%" align="right">常用软件:</td>
<td><%=rs("soft")%></td>
</tr>
<tr>
<td width="41%" align="right">个人特长:</td>
<td><%=rs("techang")%></td>
</tr>
<tr>
<td width="41%" align="right">注册时间:</td>
<td width="59%"><%=rs("indate")%></td>
</tr>
<tr>
<td width="41%" align="right">上传文件:</td>
<td width="59%"><%=rs("upnum")%></td>
</tr>
<tr bgcolor="#99CCFF" bordercolor="#FFFFFF">
<td colspan="2"> <div align="center">
<input type="submit" name="Submit" value="修改用户" class="buttonface">
<input type="button" value="关闭窗口" class="buttonface" onClick="MM_callJS('window.close()')">
</div></td>
</tr>
</form>
</table></td>
</tr>
<tr>
<td align="center" bgcolor="#FFCC00">版权所有 © 2003-2006 <a href="http://www.wlong3d.com/">www.wlong3d.com</a></td>
</tr>
</table>
<% end if
rs.close
end sub
sub chkinfo()
if request.form("nickname")="" then
response.write "<script>alert('对不起!你还没有填写昵称!');history.back();</script>"
finderr=true
end if
if request.form("passwd")="" then
response.write "<script>alert('对不起!你还没有填写密码!');history.back();</script>"
finderr=true
end if
sql="select * from [user] where userid<>"&trim(request("userid"))&" and nickname='"&request.form("nickname")&"'"
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
Response.write "<script>alert('【"&nickname&"】昵称已经被别人注册了,请另外选择一个昵称!');history.back();</script>"
Response.end
finderr=true
end if
rs.close
if finderr<>true then
sql="select * from [user] where userid="&trim(request("userid"))
rs.open sql,conn,1,3
rs("nickname")=trim(request.form("nickname"))
if request.form("username")<>"" then
rs("username")=trim(request.form("username"))
end if
rs("passwd")=trim(request.form("passwd"))
rs.update
rs.close
response.write "<script>alert('用户资料修改完成!');window.close();</script>"
end if
end sub
set rs=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -