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

📄 user_data.asp

📁 关于网络渗透技术的详细讲解
💻 ASP
字号:
<!--#include file="function.asp"-->
<!--#include file="conn.asp"-->
<%
	if session("flag")>2 then
		response.write "<br><p align=center>您没有操作的权限</p>"
		response.end
	end if
%>
<title>网上办税系统</title>
<link href="/images/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
@import url("wsbs.css");
-->
</style>
</head>

<body bgcolor=#ccccff>
<br><br><br>
<table width="600" border="0" align="left" cellpadding="0" cellspacing="0">
<tr><td>
<%
action_e=request.Querystring("action")
Select Case action_e
	Case ""
	  Call main()
	Case "save_data"
	  Call save_data()
end select
%>
<%sub main()%>
<form name="form1" method="post" action="user_data.asp?action=save_data">
<table width="400" border="0" align="center" cellpadding="0" cellspacing="5">
  <tr>
    <td align="center" valign="top">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from user where username='"&session("username")&"'"
rs.open sql,conn,1,1
id=rs("id")
lbid=rs("lbid")
faren=rs("faren")
pwd=rs("password")
pwd_qu=rs("pwd_qu")
pwd_an=rs("pwd_an")
copname=rs("copname")
email=rs("email")
tel=rs("tel")
rs.close
%>
        <table width="400" border="0" cellspacing="5" cellpadding="0">
          <tr>
            <td width="100" height="25" align="right">用户密码:</td>
            <td><input name="password" type="password" class="input2" id="password" size="20">
            (不修改请留空)</td>
          </tr>
          <tr>
            <td height="25" align="right">确认用户名密码:</td>
            <td><input name="re_password" type="password" class="input2" id="re_password" size="20"></td>
          </tr>
          <tr>
            <td height="25" align="right">密码提示问题:</td>
            <td><input name="pwd_qu" type="text" class="input2" id="pwd_qu" value="<%=pwd_qu%>" size="20" maxlength="50"></td>
          </tr>
          <tr>
            <td height="25" align="right">密码提示答案:</td>
            <td><input name="pwd_an" type="text" class="input2" id="pwd_an" size="20" maxlength="50">
            (不修改请留空)</td>
          <tr>
            <td height="25" align="right">企业名称:</td>
            <td><input name="copname" type="text" class="input2" id="copname" value="<%=copname%>" size="32" maxlength="16"></td>
          </tr>
          <tr>
            <td height="25" align="right">法人代表:</td>
            <td><input name="faren" type="text" class="input2" id="faren" value="<%=faren%>" size="20" maxlength="4"></td>
          </tr>
          </tr>
          <tr align="center">
            <td height="40" colspan="2">[以下为非必填项]</td>
          </tr>

          <tr>
            <td height="25" align="right">E-Mail地址:</td>
            <td><input name="email" type="text" class="input2" id="email" value="<%=email%>" size="20"></td>
          </tr>
          <tr>
            <td height="25" align="right">固定电话:</td>
            <td><input name="tel" type="text" class="input2" id="tel" style="ime-mode:disabled" onKeyUp="value=value.replace(/[^\d]/g,'') " value="<%=tel%>" size="20" maxlength="11" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"></td>
          </tr>
          <tr align="center">
            <td height="40" colspan="2"><input name="Submit" type="submit" value="确定修改">
                </td>
          </tr>
      </table></td>
  </tr>
</table>
</form>
<%end sub%>

<%
sub save_data()


set rs=server.createobject("adodb.recordset")
sql="select * from user where username='"&session("username")&"'"
rs.open sql,conn,1,1
if rs.eof then
	nr()
	response.write"<script language=javascript>alert('不存在的用户');history.back();</Script>"
	response.end
end if
rs.close
if request.form("password")<>"" then
	if myobj.ChkLen(request.form("password"))<6 or myobj.ChkLen(request.form("password"))>24 then
		response.write"<script language=javascript>alert('用户密码长度必须为6-24个字符');history.back();</Script>"
		response.end
	end if
	if request.form("password")<>request.form("re_password") then
		response.write"<script language=javascript>alert('两次输入的用户密码必须相同');history.back();</Script>"
		response.end
	end if
end if
if request.form("pwd_qu")="" then
	response.write"<script language=javascript>alert('请填写密码提示问题');history.back();</Script>"
	response.end
end if
if myobj.ChkLen(request.form("pwd_qu"))<8 or myobj.ChkLen(request.form("pwd_qu"))>50 then
	response.write"<script language=javascript>alert('密码提示问题长度必须为8-50个字符(汉字占两个字符)');history.back();</Script>"
	response.end
end if
if request.form("pwd_qu")=request.form("password") then
	response.write"<script language=javascript>alert('密码提示问题不能与用户密码相同');history.back();</Script>"
	response.end
end if
if request.form("pwd_an")<>"" then
	if myobj.ChkLen(request.form("pwd_an"))<8 or myobj.ChkLen(request.form("pwd_an"))>50 then
		response.write"<script language=javascript>alert('密码提示答案长度必须为8-50个字符(汉字占两个字符)');history.back();</Script>"
		response.end
	end if
	if request.form("pwd_an")=request.form("pwd_qu") then
		response.write"<script language=javascript>alert('密码提示的答案不能与密码提示问题相同');history.back();</Script>"
		response.end
	end if
	if request.form("pwd_an")=request.form("password") then
		response.write"<script language=javascript>alert('密码提示答案不能与用户密码相同');history.back();</Script>"
		response.end
	end if
end if
if request.form("copname")="" then
	response.write"<script language=javascript>alert('请填写企业名称');history.back();</Script>"
	response.end
end if
if request.form("faren")="" then
	response.write"<script language=javascript>alert('请填写法人代表');history.back();</Script>"
	response.end
end if

if request.form("copname")<>"" then
	if myobj.chkcn(request.form("copname"))=false then
		response.write"<script language=javascript>alert('企业名称只能填写汉字');history.back();</Script>"
		response.end
	end if
	if len(request.form("copname"))<2 or len(request.form("copname"))>16 then
		response.write"<script language=javascript>alert('企业名称不能少于2个汉字或多于16个汉字');history.back();</Script>"
		response.end
	end if
end if
if request.form("faren")<>"" then
	if myobj.chkcn(request.form("faren"))=false then
		response.write"<script language=javascript>alert('法人代表只能填写汉字');history.back();</Script>"
		response.end
	end if
	if len(request.form("faren"))<2 or len(request.form("faren"))>4 then
		response.write"<script language=javascript>alert('法人代表不能少于2个汉字或多于4个汉字');history.back();</Script>"
		response.end
	end if
end if
if request.form("email")<>"" then
	if myobj.ChkLen(request.form("email"))>50 then
		response.write"<script language=javascript>alert('电子邮件地址不能大于50个字符');history.back();</Script>"
		response.end
	end if
	if myobj.ChkEmail(request.form("email"))=false then
		response.write"<script language=javascript>alert('电子邮件地址格式错误');history.back();</Script>"
		response.end
	end if
end if
if request.form("tel")<>"" then
	if myobj.ChkNum(request.form("tel"))=false then
		response.write"<script language=javascript>alert('固定电话的只能填写0-9的数字');history.back();</Script>"
		response.end
	end if
end if

set rs=server.createobject("adodb.recordset")
sql="select * from user where username='"&session("username")&"'"
rs.open sql,conn,1,3
if request.form("password")<>"" then
rs("password")=request.form("password")
end if
rs("pwd_qu")=request.form("pwd_qu")
if request.form("pwd_an")<>"" then
rs("pwd_an")=request.form("pwd_an")
end if
if request.form("copname")<>"" then
rs("copname")=request.form("copname")
end if
if request.form("faren")<>"" then
rs("faren")=request.form("faren")
end if
rs("email")=request.form("email")
rs("tel")=request.form("tel")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<table width="450" height="280" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="top"><table width="400" height="25" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td align="center">&nbsp;</td>
        </tr>
      </table>
      <table width="420" height="50" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td align="center" style="font-size:14px">用户资料修改成功!<a href=logout.asp target=_top>退出重登录</a></td>
        </tr>
      </table>
</td>
  </tr>
</table>
<%end sub%>
<!--尾-->	
	</td>
  </tr>
</table>

⌨️ 快捷键说明

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