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

📄 useredit.asp

📁 紫碟轩留言本V2.0的简单原代码请 查阅
💻 ASP
字号:
<!--#include file="md5.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="sub.asp" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=webname%></title>
</head>

<body>
<SCRIPT LANGUAGE="JavaScript">
function changeimage()
		{
			document.form2.showimages.src=document.form2.u_face.value;
		}
</SCRIPT>
<% 
if request.QueryString("act")="edit" then
   if request.Form("u_mail")="" then 	
	 mgbox"你还没有填写邮箱哦,请输入邮箱"
	 response.End()
	 elseIf instr(Request.Form("u_mail"),"@")=0 or instr(Request.Form("u_mail"),".")=0  then 	
	 mgbox"邮箱格式不正确 ,请输入正确的格式"
	 response.End()
	 elseif len(request.Form("u_mail"))>50 then
	 mgbox"邮箱地址不能大于50字符"
	 response.End()
	  end if
	 if request.Form("u_qq")<>"" then
	 If Len(request.Form("u_qq"))<5 or Len(request.Form("u_qq"))>9 or Not IsNumeric(request.Form("u_qq"))     then
	mgbox"QQ号码错误:\n\n① QQ号码只能是数字。\n\n② QQ号码不能低于4位数 \n\n③ QQ号码不能高于9位数\n\n④ 如果你没有QQ号码可以不填!"
	 response.End()
	 End If
	end if
	If len(request.Form("u_qm"))>200 then
	mgbox"签名字数请限制在200以内"
	 response.End()
	 end if
	 	If len(request.Form("u_home"))>30 then
	mgbox"个人主页限制在30字符以内"
	 response.End()
	 end if
set rst=server.createobject("adodb.recordset")
rst.open "select * from zdu where u_name='"&session("user")&"'",conn,1,3
if request.Form("u_pass")<>"" then
 pass=rst("u_pass")
 if pass<>md5(md5(request.Form("u_pass"))) then
 mgbox"对不起,你输入的原密码错误"
 response.End()
 else
     if len(request.Form("u_pass1"))<6 or len(request.Form("u_pass1"))>20 then
	  mgbox"密码不能大于20个字符,不能小于6个字符"
	  response.End()
	  else
      if request.Form("u_pass1")<>request.Form("u_pass2") then
      mgbox"你两次输入的新密码不一样"
      response.End()
	  else
	  rst("u_pass")=MD5(MD5(request.Form("u_pass1")))
      end if
     end if
  end if
end if
rst("u_mail")=server.HTMLEncode(request.Form("u_mail"))
rst("u_qq")=request.Form("u_qq")
rst("u_face")=request.Form("u_face")
rst("u_home")=server.HTMLEncode(request.Form("u_home"))
rst("u_qm")=server.HTMLEncode(request.Form("u_qm"))
rst.update
rst.close
set rst=nothing%>
<script>  
alert("资料修改成功!");  
location.href="index.asp";  
</script>
<%end if%>
<%
user=request.QueryString("user")
if  user<>session("user") or user="" then
mgbox"对不起,你不能执行该操作\n\n1、你还没有登陆\n\n2、登陆超时\n\n3、错误的参数,请不要手动修改各项参数"
response.End()
end if
set rs1=server.createobject("adodb.recordset")
exec1="select * from zdu where u_name='"&session("user")&"'"
rs1.open exec1,conn,1,1
%>
<!--#include file="top.asp" -->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--页面头部-->
  <tr>
    <td height="30">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--公告内容-->
  <tr>
    <td width="100%" height="20" valign="middle"></td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="4" cellspacing="0">
  <!--签写留言,分类-->
  <tr valign="middle">
    <td width="10%" bgcolor="#FFCC99"><a href="index.asp">·返回首页</a></td>
    <td width="76%" bgcolor="#FFCC99">&nbsp;</td>
    <td width="14%" bgcolor="#FFCC99" class="putongziti"><b><a href="add.asp"><font color="#FF0000">·签写留言</font></a></b></td>
  </tr>
</table>
<table width="100%" align="center" cellpadding="0" cellspacing="1">
  <!--循环留言-->
  <tr>
    <td width="100%" align="center"><br />
      <table width="100%" border="0">
        <tr>
          <td width="100%" height="20" align="center" bgcolor="#0099CC"class="dhzi">用户资料修改</td>
        </tr>
        <tr>
          <td height="20" align="center" valign="top"class="dhzi"><form name="form2" method="post" action="?act=edit">
            <table width="98%" border="0" align="center">
              <tr>
                <td width="29%" align="right">用户名:</td>
                <td width="34%"><%=rs1("u_name")%></td>
                <td width="37%"><font color="#FF0000">*不可修改</font></td>
              </tr>
              <tr>
                <td align="right">原密码:</td>
                <td><input name="u_pass" type="password" id="u_pass" value="" size="33"></td>
                <td><font color="#FF0000">*不修改请保持空白</font></td>
              </tr>
              <tr>
                <td align="right">新密码:</td>
                <td><input name="u_pass1" type="password" id="u_pass1" value="" size="33"></td>
                <td><font color="#FF0000">*6-20个字符</font></td>
              </tr>
              <tr>
                <td align="right">密码确认:</td>
                <td><input name="u_pass2" type="password" id="u_pass2" value="" size="33"></td>
                <td><font color="#FF0000">*请再次输入密码确认</font></td>
              </tr>
              <tr>
                <td align="right">E-MAIL:</td>
                <td><input name="u_mail" type="text" id="u_mail" value="<%=rs1("u_mail")%>" size="30"></td>
                <td><font color="#FF0000">*请输入你常用的邮箱</font></td>
              </tr>
              <tr>
                <td align="right">以下为选填信息</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="right" valign="top">用户头像:</td>
                <td valign="top"><select name="u_face" id="u_face" onChange="changeimage();">
				<option value="<%=rs1("u_face")%>" selected>选者头像</option>
                  <option value="images/face/1.gif">头像1</option>
                  <option value="images/face/2.gif">头像2</option>
                  <option value="images/face/3.gif">头像3</option>
                  <option value="images/face/4.gif">头像4</option>
                  <option value="images/face/5.gif">头像5</option>
                  <option value="images/face/6.gif">头像6</option>
                </select>
                  <br />
                  <img src="<%=rs1("u_face")%>" name="showimages" width="100" height="100" id="showimages" /></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="right">QQ号码:</td>
                <td><input name="u_qq" type="text" id="u_qq" value="<%=rs1("u_qq")%>" size="30"></td>
                <td>*请输入你常用的QQ号码</td>
              </tr>
              <tr>
                <td align="right">个人主页:</td>
                <td><input name="u_home" type="text" id="u_home" value="<%=rs1("u_home")%>" size="30"></td>
                <td>*输入你的个人主页地址</td>
              </tr>
              <tr>
                <td align="right">个性签名:</td>
                <td><textarea name="u_qm" cols="40" rows="5" id="u_qm"><%=rs1("u_qm")%></textarea></td>
                <td valign="bottom">*支持UBB,签名在200字符以内</td>
              </tr>
              <tr>
                <td align="right">&nbsp;</td>
                <td align="right"><input name="Submit23" type="submit"  value=" 修  改  "style="BACKGROUND-COLOR:   #2071a0;   BORDER-BOTTOM:   1px   double;   BORDER-LEFT:   1px   double;   BORDER-RIGHT:   1px   double;   BORDER-TOP:   1px   double;   COLOR:   #eeeeee;   TEXT-ALIGN:   center" onMouseOver="this.style.color='#ffff00'"onmouseout="this.style.color='#eeeeee'" />
                  &nbsp;  &nbsp;&nbsp;  &nbsp;  &nbsp;&nbsp;  &nbsp; &nbsp; &nbsp;  &nbsp;&nbsp;  &nbsp;  &nbsp;&nbsp; 
                  <input name="Submit22" type="reset"  value="重新填写"style="BACKGROUND-COLOR:   #2071a0;   BORDER-BOTTOM:   1px   double;   BORDER-LEFT:   1px   double;   BORDER-RIGHT:   1px   double;   BORDER-TOP:   1px   double;   COLOR:   #eeeeee;   TEXT-ALIGN:   center" onMouseOver="this.style.color='#ffff00'"onMouseOut="this.style.color='#eeeeee'" /></td>
                <td>&nbsp;</td>
              </tr>
            </table>
                    </form>
          </td>
        </tr>
      </table></td></tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--版权-->
  <tr>
    <td width="100%" height="20" > <%call ksmyboot%> </td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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