📄 user_data.asp
字号:
</table></td>
</tr>
</table>
</form>
<%
end sub
sub save_data()
call myobj.chkrq()
set rs=server.createobject("adodb.recordset")
rs.open "select * from member where userid='"&request.cookies("userid")&"'",conn,1,1
if rs.eof then
nr()
response.write"<script language=javascript>alert('不存在的用户');history.back();</Script>"
response.end
end if
cr()
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.cookies("u_type")=3 then
if request.form("bdip0")="" or request.form("bdip1")="" or request.form("bdip2")="" or request.form("bdip3")="" then
response.write"<script language=javascript>alert('请将与您用户账号绑定的IP地址填写完整');history.back();</Script>"
response.end
end if
if myobj.ChkNum(request.form("bdip0"))=false or myobj.ChkNum(request.form("bdip1"))=false or myobj.ChkNum(request.form("bdip2"))=false or myobj.ChkNum(request.form("bdip3"))=false then
response.write"<script language=javascript>alert('IP地址只能填写0-255的数字');history.back();</Script>"
response.end
end if
if request.form("bdip0")=0 and request.form("bdip1")=0 and request.form("bdip2")=0 and request.form("bdip3")=0 then
response.write"<script language=javascript>alert('绑定的IP地址是无效的或是保留的特殊IP地址,请重新填写');history.back();</Script>"
response.end
end if
if request.form("bdip0")=255 and request.form("bdip1")=255 and request.form("bdip2")=255 and request.form("bdip3")=255 then
response.write"<script language=javascript>alert('绑定的IP地址是无效的或是保留的特殊IP地址,请重新填写');history.back();</Script>"
response.end
end if
if request.form("bdip0")=127 and request.form("bdip1")=0 and request.form("bdip2")=0 and request.form("bdip3")=1 then
response.write"<script language=javascript>alert('绑定的IP地址是无效的或是保留的特殊IP地址,请重新填写');history.back();</Script>"
response.end
end if
if request.form("bdip0")=224 and request.form("bdip1")=0 and request.form("bdip2")=0 and request.form("bdip3")=1 then
response.write"<script language=javascript>alert('绑定的IP地址是无效的或是保留的特殊IP地址,请重新填写');history.back();</Script>"
response.end
end if
if request.form("bdip0")=224 and request.form("bdip1")=0 and request.form("bdip2")=0 and request.form("bdip3")=2 then
response.write"<script language=javascript>alert('绑定的IP地址是无效的或是保留的特殊IP地址,请重新填写');history.back();</Script>"
response.end
end if
if request.form("bdip0")=169 and request.form("bdip1")=254 then
response.write"<script language=javascript>alert('绑定的IP地址是无效的或是保留的特殊IP地址,请重新填写');history.back();</Script>"
response.end
end if
edit_bdip=request.form("bdip0")&"."&request.form("bdip1")&"."&request.form("bdip2")&"."&request.form("bdip3")
set rs=server.createobject("adodb.recordset")
rs.open "select * from member where u_type=3 and bd_ip='"&edit_bdip&"'",conn,1,1
if not rs.eof then
call nr()
response.write"<script language=javascript>alert('您要绑定的IP地址已经被本站其它用户绑定!');history.back();</Script>"
response.end
end if
rs.close
end if
if request.form("u_name")<>"" then
if myobj.chkcn(request.form("u_name"))=false then
response.write"<script language=javascript>alert('真实姓名只能填写汉字');history.back();</Script>"
response.end
end if
if len(request.form("u_name"))<2 or len(request.form("u_name"))>4 then
response.write"<script language=javascript>alert('真实姓名不能少于2个汉字或多于4个汉字');history.back();</Script>"
response.end
end if
end if
if request.form("u_sex")<>"" then
if myobj.chkbool(request.form("u_sex"))=false then
response.write"<script language=javascript>alert('用户性别的值错误');history.back();</Script>"
response.end
end if
end if
if request.form("b_year")<>"" or request.form("b_month")<>"" or request.form("b_day")<>"" then
if request.form("b_year")="" or request.form("b_month")="" or request.form("b_day")="" then
response.write"<script language=javascript>alert('请将出生日期填写完整');history.back();</Script>"
response.end
end if
if isdate(request.form("b_year")&"-"&request.form("b_month")&"-"&request.form("b_day"))=false then
response.write"<script language=javascript>alert('您填写的出生日期无效');history.back();</Script>"
response.end
end if
end if
if request.form("u_add")<>"" then
if myobj.chkcn(request.form("u_add"))=false then
response.write"<script language=javascript>alert('用户所在地区的值错误');history.back();</Script>"
response.end
end if
end if
if request.form("u_qq")<>"" then
if myobj.ChkLen(request.form("u_qq"))<5 or myobj.ChkLen(request.form("u_qq"))>20 then
response.write"<script language=javascript>alert('腾讯QQ号码长度必须为5-20个数字');history.back();</Script>"
response.end
end if
if myobj.ChkNum(request.form("u_qq"))=false then
response.write"<script language=javascript>alert('腾讯QQ号码只能填写0-9的数字');history.back();</Script>"
response.end
end if
if left(request.form("u_qq"),1)=0 then
response.write"<script language=javascript>alert('腾讯QQ号码的第一个数字不能是');history.back();</Script>"
response.end
end if
end if
if request.form("u_msn")<>"" then
if myobj.ChkLen(request.form("u_msn"))>50 then
response.write"<script language=javascript>alert('MSN地址不能大于50个字符');history.back();</Script>"
response.end
end if
if myobj.ChkEmail(request.form("u_msn"))=false then
response.write"<script language=javascript>alert('MSN地址格式错误');history.back();</Script>"
response.end
end if
end if
if request.form("u_email")<>"" then
if myobj.ChkLen(request.form("u_email"))>50 then
response.write"<script language=javascript>alert('电子邮件地址不能大于50个字符');history.back();</Script>"
response.end
end if
if myobj.ChkEmail(request.form("u_email"))=false then
response.write"<script language=javascript>alert('电子邮件地址格式错误');history.back();</Script>"
response.end
end if
end if
if request.form("u_tel")<>"" then
if myobj.ChkNum(request.form("u_tel"))=false then
response.write"<script language=javascript>alert('固定电话的只能填写0-9的数字');history.back();</Script>"
response.end
end if
if myobj.ChkLen(request.form("u_tel"))<>11 then
response.write"<script language=javascript>alert('固定电话的长度必须为11个数字');history.back();</Script>"
response.end
end if
if left(request.form("u_tel"),1)<>0 then
response.write"<script language=javascript>alert('固定电话的第一个数字只能是0');history.back();</Script>"
response.end
end if
end if
if request.form("u_mtel")<>"" then
if myobj.ChkLen(request.form("u_mtel"))<>11 then
response.write"<script language=javascript>alert('手机号码必须是11位的数字');history.back();</Script>"
response.end
end if
if left(request.form("u_mtel"),1)<>1 then
response.write"<script language=javascript>alert('手机号码的第一个数字只能是1');history.back();</Script>"
response.end
end if
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from member where userid='"&request.cookies("userid")&"'",conn,1,3
if request.form("password")<>"" then
rs("u_pwd")=md5(request.form("password"))
end if
rs("pwd_qu")=request.form("pwd_qu")
if request.form("pwd_an")<>"" then
rs("pwd_an")=md5(request.form("pwd_an"))
end if
if request.cookies("u_type")=3 then
rs("bd_ip")=request.form("bdip0")&"."&request.form("bdip1")&"."&request.form("bdip2")&"."&request.form("bdip3")
end if
if request.form("u_name")<>"" then
rs("u_name")=request.form("u_name")
end if
if request.form("u_sex")<>"" then
rs("u_sex")=request.form("u_sex")
end if
if request.form("u_sex")<>"" then
rs("u_sex")=request.form("u_sex")
end if
if request.form("b_year")<>"" and request.form("b_month")<>"" and request.form("b_day")<>"" and isdate(request.form("b_year")&"-"&request.form("b_month")&"-"&request.form("b_day"))=true then
rs("bd_time")=request.form("b_year")&"-"&request.form("b_month")&"-"&request.form("b_day")&" "&request.form("b_time")
end if
if request.form("u_add")<>"" then
rs("u_add")=request.form("u_add")
end if
if request.form("u_qq")<>"" then
rs("u_qq")=request.form("u_qq")
end if
if request.form("u_msn")<>"" then
rs("u_msn")=request.form("u_msn")
end if
if request.form("u_email")<>"" then
rs("u_email")=request.form("u_email")
end if
if request.form("u_tel")<>"" then
rs("u_tel")=request.form("u_tel")
end if
if request.form("u_mtel")<>"" then
rs("u_mtel")=request.form("u_mtel")
end if
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<table width="450" height="280" border="0" align="center" 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"> </td>
</tr>
</table>
<table width="420" height="50" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">用户资料修改成功!</td>
</tr>
</table>
</td>
</tr>
</table>
<%end sub%>
<!--尾-->
</td>
</tr>
</table>
<!--#include file="footer.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -