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

📄 edit.asp

📁 很好的代码!!大家可以下
💻 ASP
字号:
<!--#include file=conn.asp --><!--#include file="char.inc"--><!--#include file=../include/config.asp --><!--#include file="chkuser.asp" -->

<%
IF request.cookies("KEY")="" THEN
response.redirect "index_face.asp"
response.end
else
usernamecookie=CheckStr(request.cookies("UserName"))
passwdcookie=replace(trim(Request.cookies("passwd")),"'","''")
KEYcookie=replace(trim(request.cookies("KEY")),"'","''")
if usernamecookie="" or passwdcookie="" then
response.redirect "login.asp"
response.end
else
'判断用户的合法性
  set rs=server.createobject("adodb.recordset")
  sql="select * from admin where username='"&usernamecookie&"'"
  rs.open sql,conn,1,1
  if rs.eof and rs.bof then
             response.redirect "login.asp"
            response.end
         end if
  IF passwdcookie<>rs("passwd") THEN
          response.redirect "login.asp"
           response.end
      END IF
   '下面判断用户级别实际在有用户级别是都应该判断
   if KEYcookie<>rs("OSKEY") then
      response.redirect "index_face.asp"
      response.end
    end if
           rs.close
           set rs=nothing
END IF
END IF
%>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href=site.css rel=stylesheet>
<title><%=copyright%><%=version%>&nbsp;<%=ver%> - 个人资料修改</title>
<script LANGUAGE="javascript">
<!--
function FrmAddLink_onsubmit() {
 if (document.FrmAddLink.passwd.value=="")
	{
	  alert("对不起,请您输入密码!")
	  document.FrmAddLink.passwd.focus()
	  return false
	 }
else if (document.FrmAddLink.passwd.value.length < 4)
	{
	  alert("为了安全,您的密码应该长一点!")
	  document.FrmAddLink.passwd.focus()
	  return false
	 }
else if (document.FrmAddLink.passwd.value.length > 16)
	{
	  alert("您的密码太长了吧!")
	  document.FrmAddLink.passwd.focus()
	  return false
	 }
else if (document.FrmAddLink.username.value==document.FrmAddLink.passwd.value)
	{
	  alert("为了安全,用户名与密码不应该相同!")
	  document.FrmAddLink.passwd.focus()
	  return false
	 }
else if (document.FrmAddLink.passwd2.value=="")
	{
	  alert("对不起,请您输入验证密码!")
	  document.FrmAddLink.passwd2.focus()
	  return false
	 }
else if (document.FrmAddLink.passwd2.value !== document.FrmAddLink.passwd.value)
	{
	  alert("对不起,您两次输入的密码不一致!")
	  document.FrmAddLink.passwd2.focus()
	  return false
	 }
else if (document.FrmAddLink.question.value=="")
	{
	  alert("对不起,请您输入提示问题!")
	  document.FrmAddLink.question.focus()
	  return false
	 }
else if (document.FrmAddLink.answer.value=="")
	{
	  alert("对不起,请您输入问题答案!")
	  document.FrmAddLink.answer.focus()
	  return false
	 }
else if (document.FrmAddLink.question.value==document.FrmAddLink.answer.value)
	{
	  alert("为了安全,提示问题与问题答案不应该相同!")
	  document.FrmAddLink.answer.focus()
	  return false
	 }
else if (document.FrmAddLink.fullname.value=="")
	{
	  alert("对不起,请输入您的真实姓名!")
	  document.FrmAddLink.fullname.focus()
	  return false
	 }
else if (document.FrmAddLink.depid.value=="")
	{
	  alert("对不起,请输入您的工作单位!")
	  document.FrmAddLink.depid.focus()
	  return false
	 }
else if (document.FrmAddLink.sex.value=="")
	{
	  alert("对不起,请输入您的性别!")
	  document.FrmAddLink.sex.focus()
	  return false
	 }
}

//-->
</script>
</head>
<body topmargin="0">
<%dim logins
set rs=server.createobject("adodb.recordset")
sql="select * from admin where username='"&usernamecookie&"'"
rs.open sql,conn,1,3
logins=rs("logins")
rs.close
set rs=nothing
if logins>1 then
%>
<!--#include file=top.asp--><%end if%>
<form method="POST" name="FrmAddLink" language="javascript"
    onSubmit="return FrmAddLink_onsubmit()"  action="save.asp?username=<%=request.cookies("username")%>">
  <table width="459" border="1" align=center cellpadding="0" cellspacing="0" bordercolor="<%=border%>" style="border-collapse: collapse">
    <%
dim sql
dim rs
 sql="select * from admin where username='"&usernamecookie&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
         
%>
    <p>&nbsp;</p>
    <tr bgcolor="<%=m_top%>">
      <td height=30 colspan="2"><p align="center">
          <%if logins=1 then%>
          <font color=red>这是您首次使用本系统,为了安全,请立即修改您的个人资料后再执行管理操作。</font><br>
          <%end if%>
          <%=request.cookies("fullname")%>修改资料</td>
    </tr>
    <tr>
      <td width="94" height="26"><p align="right">用 户 名:</td>
      <td width="359" height="26"><input name="username" size="30" value="<%=rs("username")%>" readonly class="smallInput" maxlength="30" style="font-family: 宋体; font-size: 9pt">
      </td>
    </tr>
    <tr>
      <td height="26"><p align="right">密&nbsp;&nbsp;&nbsp; 码:</td>
      <td height="26"><input name="passwd" type="password" size="30" value="<%=rs("passwd")%>" class="smallInput" maxlength="50" style="font-family: 宋体; font-size: 9pt" <%if request.cookies("key")="smallmaster" and inputmodpwd="0" then%>readonly<%end if%>>
          <%if request.cookies("key")="smallmaster" and inputmodpwd="0" then%>
          该用户不允许修改密码
          <%end if%>
      </td>
    </tr>
    <tr>
      <td height="26"><p align="right">验证密码:</td>
      <td height="26"><input name="passwd2" type="password" size="30" value="<%=rs("passwd")%>" class="smallInput" maxlength="50" style="font-family: 宋体; font-size: 9pt" <%if request.cookies("key")="smallmaster" and inputmodpwd="0" then%>readonly<%end if%>>
          <%if request.cookies("key")="smallmaster" and inputmodpwd="0" then%>
          该用户不允许修改密码
          <%end if%>
      </td>
    </tr>
    <tr>
      <td height="26"><p align="right">提示问题:</td>
      <td height="26"><input name="question" type="text" size="30" value="<%=rs("question")%>" class="smallInput"  style="font-family: 宋体; font-size: 9pt">
      </td>
    </tr>
    <tr>
      <td height="26"><p align="right">问题答案:</td>
      <td height="26"><input name="answer" type="text" size="30" value="<%=rs("answer")%>" class="smallInput"   style="font-family: 宋体; font-size: 9pt">
      </td>
    </tr>
    <tr>
      <td height="26"><p align="right">真实姓名:</td>
      <td height="26"><input name="fullname" type="text" size="30" value="<%=rs("fullname")%>" class="smallInput"   style="font-family: 宋体; font-size: 9pt">
      </td>
    </tr>
    <tr>
      <td height="26"><p align="right">工作单位:</td>
      <td height="26"><% 
                  set rstype=createobject("adodb.recordset")
                  sql="select * from dep order by id"
                  rstype.Open sql,conn,1,3
                  %>
          <select name="depid" style="font-family: 宋体; font-size: 9pt">
            <option value="">请选择工作单位</option>
            <%do while not rstype.EOF%>
            <option value="<%=rstype("id")%>" <%if rs("depid")=cint(rstype("id")) then%> selected <%end if%>><%=rstype("depname")%></option>
            <%
                  rstype.MoveNext
                  loop
                  set rstype=nothing
                  %>
        </select></td>
    </tr>
    <tr>
      <td height="26"><p align="right">性&nbsp;&nbsp;&nbsp; 别:</td>
      <td height="26"><select size="1" name="sex" style="font-family: 宋体; font-size: 9pt" >
          <option <%if rs("sex")="先生" then%>selected<%end if%> value="先生">先生</option>
          <option <%if rs("sex")="女士" then%>selected<%end if%> value="女士">女士</option>
          <option <%if rs("sex")="保密" then%>selected<%end if%> value="保密">保密</option>
      </select></td>
    </tr>
    <tr>
      <td height="26"><p align="right">生&nbsp;&nbsp;&nbsp; 日:</td>
      <td height="26" ><div align="left">
          <select size="1" name="birthyear" style="font-family: 宋体; font-size: 9pt">
            <%for i=1950 to 2000%>
            <option <%if rs("birthyear")=i then%>selected<%end if%> value="<%=i%>"><%=i%></option>
            <%next%>
          </select>
          <select size="1" name="birthmonth" style="font-family: 宋体; font-size: 9pt">
            <%for i=1 to 12%>
            <option <%if rs("birthmonth")=i then%>selected<%end if%> value="<%=i%>"><%=i%></option>
            <%next%>
          </select>
          <select size="1" name="birthday" style="font-family: 宋体; font-size: 9pt">
            <%for i=1 to 31%>
            <option <%if rs("birthday")=i then%>selected<%end if%> value="<%=i%>"><%=i%></option>
            <%next%>
          </select>
          日</div></td>
    </tr>
    <tr>
      <td height="26"><p align="right">联系电话:</td>
      <td height="26" valign="middle"><input name="tel" size="30" class="smallInput" value="<%=rs("tel")%>" maxlength="100" style="font-family: 宋体; font-size: 9pt" ></td>
    </tr>
    <tr>
      <td height="26"><p align="right">电子邮件:</td>
      <td height="26"><input name="email" type="text" size="30" value="<%=rs("email")%>" class="smallInput"   style="font-family: 宋体; font-size: 9pt">
      </td>
    </tr>
    <tr>
      <td height="26"><p align="right">自我介绍:</td>
      <td height="26"><textarea rows="5" name="content" cols="30" style="font-family: 宋体; font-size: 9pt"><%=rs("content")%></textarea>
      </td>
    </tr>
    <tr>
      <td height="26" colspan="2"><p align="center">
          <input type="submit" value="修 改"
  name="cmdok" class="buttonface" style="font-family: 宋体; font-size: 9pt;">
  &nbsp;
          <input type="reset" value="复 原"
  name="cmdcancel" class="buttonface" style="font-family: 宋体; font-size: 9pt;">
  &nbsp;
          <input type="reset" value="返 回" onclick="javascript:history.go(-1)" class="buttonface" style="font-family: 宋体; font-size: 9pt;">
        </td>
    </tr>
    <tr>
      <td colspan="2" align=center></td>
    </tr>
  </table>
</form>
</body>

</html><% 
rs.close 
%>

⌨️ 快捷键说明

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