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

📄 edituser.asp

📁 asp程序,自动投稿系统,也可以用来学生交作业,原创程序.
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
username=session("username")
sql="select * from user where username='"&username&"'"
rs.open sql,conn,1,2
if request.form("active")="active" then

'===========================验证表单内容是否合法(开始)====================================================================


username=trim(request.form("username"))
password=trim(request.form("password"))
password2=trim(request.form("password2"))
name=trim(request.form("name"))
tel=trim(request.form("tel"))
shouji=trim(request.form("shouji"))
youbian=trim(request.form("youbian"))
mail=trim(request.form("mail"))
dizhi=trim(request.form("dizhi"))
danwei=trim(request.form("danwei"))

if username="" or password="" or password2="" or name="" or tel="" or shouji="" or youbian="" or mail="" or dizhi="" or danwei=""  then
     response.write "<SCRIPT language=JavaScript>alert('为了保证编辑部能和您成功联系,所有项目必须认真填写');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
end if

if instr(Request("username")," ")>0 or instr(Request("username"),"'")>0 then
     response.write "<SCRIPT language=JavaScript>alert('用户名中含有非法字符');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
end if

if  len(username)>8 or len(username)<2 then
     response.write "<SCRIPT language=JavaScript>alert('用户名不能大于8小于2');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
end if


if  len(password)>16 or len(password)<6 then
     response.write "<SCRIPT language=JavaScript>alert('密码长度为6-16个字符');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
end if


	if password<>password2 then
     response.write "<SCRIPT language=JavaScript>alert('密码和确认密码不一致');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
	end if



  if not(isnumeric(shouji)) then 
     response.write "<SCRIPT language=JavaScript>alert('手机号码必须是数字');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
  end if


if not(isnumeric(youbian)) or len(youbian)<>6  then
     response.write "<SCRIPT language=JavaScript>alert('请正确输入邮编');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
end if


  if not(isnumeric(youbian)) then 
     response.write "<SCRIPT language=JavaScript>alert('邮编必须是数字');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
  end if

 if len(danwei)<8 then 
     response.write "<SCRIPT language=JavaScript>alert('请填写单位全称');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
  end if

  if len(danwei)>60 then 
     response.write "<SCRIPT language=JavaScript>alert('单位名称不能大于30字');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
  end if

 if len(dizhi)<10 then 
     response.write "<SCRIPT language=JavaScript>alert('请填写详细地址');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
  end if

  if len(dizhi)>60 then 
     response.write "<SCRIPT language=JavaScript>alert('地址不能大于30字');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
  end if


if instr(Request("mail"),"@")=0 or instr(Request("mail"),".")=0 then
	response.write "<SCRIPT language=JavaScript>alert('请按正确格式填写E-mail地址!');"
	response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
	response.end
end if	



'===================验证表单内容是否合法(结束)======================

		rs("username")=username
		rs("name")=name
		rs("password")=password
		rs("tel")=tel
		rs("youbian")=youbian
		rs("dizhi")=dizhi
		rs("mail")=mail
		rs("shouji")=shouji
		rs("danwei")=danwei

		rs("date")=date()'=在数据库里插入当前的时间,格式为年,月,日

		rs.update
		
		session("username")=rs("username")
		session("name")=rs("name")
		rs.close
		conn.close
		set rs=nothing
		response.redirect "login_ok.asp"
	
	

end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
table {
	font-size: 9pt;
	text-decoration: none;
	border: 1px solid #000000;
}
-->
</style>
<style type="text/css">
<!--
-->
</style>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<form name="form1" method="post" action="edit.asp">
  <table width="600"  border="0">
    <tr>
      <td width="25%" height="26"><div align="center">用&nbsp;户&nbsp;名</div></td>
      <td width="75%" height="26"><input type="text" name="username" value="<%=rs("username")%>"></td>
    </tr>
    <tr>
      <td height="26"><div align="center">密&nbsp;&nbsp;&nbsp;&nbsp;码</div></td>
      <td height="26"><input type="password" name="password"  value="<%=rs("password")%>"></td>
    </tr>
    <tr>
      <td height="26"><div align="center">确认密码</div></td>
      <td height="26"><input type="password" name="password2"  value="<%=rs("password")%>"></td>
    </tr>
    <tr>
      <td height="26"><div align="center">真实姓名</div></td>
      <td height="26"><input type="text" name="name"  value="<%=rs("name")%>"></td>
    </tr>
    <tr>
      <td height="26"><div align="center">工作单位</div></td>
      <td height="26"><input type="text" name="danwei"  value="<%=rs("danwei")%>"></td>
    </tr>
    <tr>
      <td height="26"><div align="center">办公电话</div></td>
      <td height="26"><input type="text" name="tel"  value="<%=rs("tel")%>"></td>
    </tr>
    <tr>
      <td height="26"><div align="center">手&nbsp;&nbsp;&nbsp;&nbsp;机</div></td>
      <td height="26"><div align="left">
        <input type="text" name="shouji"  value="<%=rs("shouji")%>">
      </div></td>
    </tr>
    <tr>
      <td height="26"><div align="center">电子邮箱</div></td>
      <td height="26"><div align="left">
        <input type="text" name="mail"  value="<%=rs("mail")%>">
      </div></td>
    </tr>
    <tr>
      <td height="26"><div align="center">通讯地址</div></td>
      <td height="26"><div align="left">
        <input type="text" name="dizhi"  value="<%=rs("dizhi")%>">
      </div></td>
    </tr>
    <tr>
      <td height="26"><div align="center">邮政编码</div></td>
      <td height="26"><div align="left">
        <input type="text" name="youbian"  value="<%=rs("youbian")%>">
      </div></td>
    </tr>
    <tr>
      <td height="26"><div align="center"></div></td>
      <td height="26"><div align="left"></div></td>
    </tr>
    <tr>
      <td height="26" colspan="2"><div align="center"></div>        <div align="left">
        <input name="Submit" type="submit" class="bt" value="提交">
        &nbsp;&nbsp;&nbsp;&nbsp;
        <input name="Submit2" type="reset" class="bt" value="重置">
      </div></td>
    </tr>
    <tr>
      <td height="26"><div align="center"></div></td>
      <td height="26"><div align="left"></div></td>
    </tr>
    <tr>
      <td height="26"><div align="center"></div></td>
      <td height="26"><div align="left"></div></td>
    </tr>
    <tr>
      <td height="26"><div align="center"></div></td>
      <td height="26"><div align="left"></div></td>
    </tr>
  </table>
  <input name="active" type="hidden" value="active">
</form>
</body>
</html>

⌨️ 快捷键说明

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