⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminuserset.asp

📁 网站代码
💻 ASP
字号:
<!--#include file="Include/conn.asp" -->
<!--#include file="Include/check.asp"-->
<!--#include file="Include/md5.asp" -->
<!--#include file="include/char.asp" -->
<!--#include file="Include/Pw_Function.asp" -->
<% CheckAdmin3%>
<HTML><HEAD><TITLE>用户管理 </TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link rel="stylesheet" href="Img/Admin.css" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
</HEAD>
<BODY>
<%
Action=trim(request("Action"))
set rs=server.createobject("adodb.recordset")
	dim trs
select case Action
case "save"
		call Saveuser()
case "edit"
		call edituser()
case else                
		call edituser()
end select 
if FoundErr=True then
	call Error_Msg(ErrMsg)
end if
sub edituser()
	set rs=conn.execute("select * from [User]  where userid="&request("userid"))
%>
<form action="?action=save" method="POST" name="ModifyUser" id="ModifyUser">
<input type=hidden value="<%=request("userid")%>" name="userid">
<table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center>
<tr> 
<td height="23" colspan="2" ><B>说明</B>:<BR>修改用户信息,只能修改其用户名和密码、邮箱。
</td>
</tr>
</table>
<table width="95%" border="0"  align=center cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#EAEAEA"> 
  <th height="23" colspan="2" >修改用户信息</th>
</tr>
<tr bgcolor="#FFFFFF"> 
  <td width="33%" bgcolor="#FFFFFF"><div align="right"><B>用户名称:</B></div></td>
  <td width="67%">    <input type="text" name="username" size="35" value="<%=rs("username")%>">  </td>
</tr>
<tr bgcolor="#FFFFFF"> 
  <td width="33%" bgcolor="#FFFFFF"><div align="right"><B>用户密码:</B></div></td>
  <td width="67%">    <input name="userpass" type="password" id="userpass" size="35">
        为安全不显示密码 (<font color="#FF0000">不修改保留</font>)</td>
</tr>
<tr bgcolor="#FFFFFF"> 
  <td width="33%" bgcolor="#FFFFFF"><div align="right"><B>电子邮件:</B></div></td>
  <td width="67%">    <input type="text" name="useremail" size="35" value="<%=rs("useremail")%>">  </td>
</tr>
<tr bgcolor="#FFFFFF"> 
  <td width="33%">&nbsp;</td>
  <td width="67%">    <input name="Submit" type="submit" class="kuang" onClick="MM_validateForm('username','','R','useremail','','R');return document.MM_returnValue" value="提交修改">  </td>
</tr>
</table>
</form>
<BR>
<table width="95%" border="0"  align=center cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
  <tr bgcolor="#EAEAEA"> 
    <th height="23" colspan="2" >用户信息</th>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td bgcolor="#FFFFFF" class="forumrow"><div align="right"><strong>姓名:</strong></div></td>
    <td class="forumrow"><%=rs("truename")%></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td width="33%" bgcolor="#FFFFFF" class="forumrow"><div align="right"><B>性  别:</B></div></td>
    <td width="67%" class="forumrow"> <input type="radio" value="1" <%if rs("Sex")=1 then%> checked<%end if%> style="border:0px"></font> 
      男孩&nbsp; <font color="#FF0000"> 
      <input type="radio" value="0" <%if rs("Sex")=0 then%> checked<%end if%> style="border:0px">
      </font>女孩</td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td width="33%" bgcolor="#FFFFFF" class="forumrow"><div align="right"><B>OICQ:</B></div></td>
    <td width="67%" class="forumrow"> <%=rs("Oicq")%></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td bgcolor="#FFFFFF" class="forumrow"><div align="right"><strong>EMail:</strong></div></td>
    <td class="forumrow"><%=rs("UserEmail")%></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td width="33%" bgcolor="#FFFFFF" class="forumrow"><div align="right"><B>邮政编码:</B></div></td>
    <td width="67%" class="forumrow"> <% if isnull(rs("Postcode")) then response.write "没有填写" else  response.write rs("Postcode")end if %></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td width="33%" bgcolor="#FFFFFF" class="forumrow"><div align="right"><B>联系电话:</B></div></td>
    <td width="67%" class="forumrow"> <% if isnull(rs("Tel")) then response.write "没有填写" else  response.write rs("Tel")end if %></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td width="33%" bgcolor="#FFFFFF" class="forumrow"><div align="right"><B>联系地址:</B></div></td>
    <td width="67%" class="forumrow"> <% if isnull(rs("Address")) then response.write "没有填写" else  response.write rs("Address")end if %></td>
  </tr>
</table>
<%
	rs.close
	set rs=nothing
	end sub
Sub saveuser()
if request("userpass")<>"" then
conn.execute("update [user] set username='"&request("username")&"',userpass='"&md5(request("userpass"))&"',useremail='"&request("useremail")&"' where userid="&request("userid"))
else
conn.execute("update [user] set username='"&request("username")&"',useremail='"&request("useremail")&"' where userid="&request("userid"))
end if 
Response.Write "<script>alert(""选择的用户已成功修改!"");location.href='"&request.servervariables("HTTP_REFERER")&"';</script>"

End Sub
%>
 <p align="center"><%=Ver%><BR><%=Copyright%></p>
</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -