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

📄 changeinfo2.asp

📁 迅捷网上调查系统管理
💻 ASP
字号:
<!--#include file="../chkuser.asp" -->
<!--#include file="../sys/inc/char.asp" -->
<!--#include file="../sys/inc/prompt.inc" -->
<!-- #Include File=top.asp -->
<%
call conned()
dim username,password,rlword,address,sex,oicq,useremail,face,homeurl,ispublic,rs,sql
dim successmess
founderr=false
call chkinput()

if founderr=true then 
	call error() 
else 
	call update()
	state="修改成功"
	reginfo()
	
end if




'----------------------------------------------------------检测输入信息
sub chkinput()
		
	username=request("username")
	'--------------------------------------------chkpost
	if chkpost=false then
   		ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法,请不要从外部提交发言。"
   		FoundErr=True
	end if


	'--------------------------------------password
	if request("password")="" or strLength(request("password"))>12 then
	errmsg=errmsg+"<br>"+"<li>请输入您的密码(长度不能大于12)!"
	founderr=true
	else
	pass1=request("password")
	end if
	if request("password2")="" or strLength(request("password2"))>12 then
	errmsg=errmsg+"<br>"+"<li>请输入确认密码(长度不能大于12)!"
	founderr=true
	else
	pass2=request("password2")
	end if
	if pass1<>pass2 then
	errmsg=errmsg+"<br>"+"<li>您输入的密码和确认密码不一致!"
	founderr=true
	else
	password=pass2
	end if


	'-------------------------------------------name
	if request("rlword")="" or strLength(request("rlword"))>20 then
	errmsg=errmsg+"<br>"+"<li>请输入您的真实姓名(长度不能大于20)!"
	founderr=true
	else
	rlword=trim(request("rlword"))
	end if
	if Instr(request("rlword"),"=")>0 or Instr(request("rlword"),"%")>0 or Instr(request("rlword"),chr(32))>0 or Instr(request("rlword"),"?")>0 or Instr(request("rlword"),"&")>0 or Instr(request("rlword"),";")>0 or Instr(request("rlword"),",")>0 or Instr(request("rlword"),"'")>0 or Instr(request("rlword"),",")>0 or Instr(request("rlword"),chr(34))>0 or Instr(request("rlword"),"+") >0 then
	errmsg=errmsg+"<br>"+"<li>您的用户名中含有非法字符!"
	founderr=true
	else
	rlword=trim(request("rlword"))
	end if
	'Response.Write (rlword)


	'----------------------------------address
	if request("address")="" or strLength(request("address"))>10 then
	errmsg=errmsg+"<br>"+"<li>请选择您的地址(长度不能大于20)!"
	founderr=true
	else
	address=trim(request("address"))
	end if
	if Instr(request("address"),"=")>0 or Instr(request("address"),"%")>0 or Instr(request("name"),chr(32))>0 or Instr(request("name"),"?")>0 or Instr(request("name"),"&")>0 or Instr(request("name"),";")>0 or Instr(request("name"),",")>0 or Instr(request("name"),"'")>0 or Instr(request("name"),",")>0 or Instr(request("name"),chr(34))>0 or Instr(request("name"),"+") >0 then
	errmsg=errmsg+"<br>"+"<li>您的地址中含有非法字符!"
	founderr=true
	else
	address=trim(request("address"))
	end if


	'-----------------------------------------sex
	if request("sex")=0 or request("sex")=1 then
		sex=request("sex")
	else
		sex=1
	end if

	'-----------------------------------------------mail
	if IsValidEmail(trim(request("e_mail")))=false then
	errmsg=errmsg+"<br>"+"<li>您的Email有错误!"
	founderr=true
	else
	useremail=trim(request("e_mail"))
	end if


	'-----------------------------------------------face
	face=request("myface")
	if request("myface")="" then
	errmsg=errmsg+"<br>"+"<li>请选择您的个性头像!"
	founderr=true
	else		
		face=request("myface")
	end if
	'response.write (face)


	'-------------------------------------------oicq
	if request("oicq")<>"" then
		if not isnumeric(request("oicq")) or len(request("oicq"))>10 then
			errmsg=errmsg+"<br>"+"<li>Oicq号码只能是4-10位数字,您可以选择不输入!。"
			founderr=true
		else oicq=request("oicq")
		end if
	end if

	'---------------------------------------------homeurl
	if  strLength(request("homeurl"))>30 then
		errmsg=errmsg+"<br>"+"<li>网址(长度不能大于30)!"
		founderr=true
	else homeurl=htmlencode(request("homeurl"))
	end if
	
	'------------------------------ispublic
	if request("ispublic")=1 then
		ispublic=request("ispublic")
	else
		ispublic=0
	end if

end sub



'---------------------------------------------更新用户信息
sub update()
	set rs=server.createobject("adodb.recordset")
	sql="Select * from [Userinfo] where busername='"&username&"'"
	rs.open sql,conn,1,3
	if rs.eof or rs.bof then
		errmsg=errmsg+"<br>"+"<li>用户名不可以修改!"
		founderr=true
		call error()
		response.end
	else
		rs("bpassword")=password
		
		rs("brlword")=rlword
				
		rs("baddress")=address		
		
		rs("bface")=face        	
						
		if request("oicq")<>"" then
			rs("boicq")=oicq
		else   
			rs("boicq")=0		
		end if
		
		Rs("bsex")=sex
		
		Rs("bmail")=useremail
		
		if request("homeurl")<>"" then
			Rs("burl")=homeurl
		else
			Rs("burl")="http://"
		end if
		
		Rs("bpublic")=ispublic
		
		Rs("btime")=now
		rs.Update
        	rs.close
		set rs=nothing	
	end if	
        	        
end sub

sub reginfo()
call top()
%>
<br><br><br>
<table border=1 cellpadding=2 cellspacing=0
width="500" align="center" bordercolor=<%=coborder%>>
  <tr> 
    <td class=td align=middle colspan="2" height="32"> 
      <p align="center"><b>信息更改成功</b><br>
        <%=sendmsg%></p>
    </td>
  </tr>
  <tr> 
    <td class=td1 align=middle 
width=483>用户名称:</td>
    <td class=td2 align=middle 
width=483> 
      <div align="left"> <%=request("username")%> </div>
    </td>
  </tr>
  <tr> 
    <td class=td1 align=middle 
width=483>您的密码:</td>
    <td class=td2 align=middle 
width=483> 
      <div align="left"> <%=request("password")%> </div>
    </td>
  </tr>
  <tr> 
    <td class=td1 align=middle 
width=483>真实姓名:</td>
    <td class=td2 align=middle 
width=483> 
      <div align="left"> <%=rlword%></div>
    </td>
  </tr>
  <tr> 
    <td class=td1 align=middle 
width=483>地区:</td>
    <td class=td2 align=middle> 
      <div align="left"> <%=address%></div>
    </td>
  </tr>
  <tr> 
    <td class=td1 align=middle 
width=483>头象:</td>
    <td class=td2 align=middle> 
      <div align="left"> <img src="<%=face%>"></div>
    </td>
  </tr>
  <tr> 
    <td class=td1 align=middle 
width=483>Oicq:</td>
    <td class=td2 align=middle 
width=483> 
      <div align="left"> <%if request("oicq")="" then%> 未注册 <%else%> <%=request("oicq")%> 
        <%end if%> </div>
    </td>
  </tr>
  <tr> 
    <td class=td1 align=middle 
width=483>您的性别:</td>
    <td class=td2 align=middle 
width=483> 
      <div align="left"><%if sex=1 then%>男 <%else%> 女 <%end if%></div>
    </td>
  </tr>
  <tr> 
    <td class=td1 align=middle 
width=483>邮箱地址:</td>
    <td class=td2 align=middle 
width=483> 
      <div align="left"> <%=useremail%></div>
    </td>
  </tr>
  <tr> 
    <td class=td1 align=middle 
width=483>主页地址:</td>
    <td class=td2 align=middle 
width=483> 
      <div align="left"> <%=homeurl%> </div>
    </td>
  </tr>
  <tr> 
    <td class=td1 align=middle 
width=483>信息公开:</td>
    <td class=td2 align=middle 
width=483> 
      <div align="left"> 
        <%if ispublic=1 then response.write"其它网友可以看到我的信息" else response.write"其它网友不能看到我的信息"%>
      </div>
    </td>
  </tr>
  <tr> 
    <td class=td align=middle colspan="2"> 
      <div align="center"> 
        <a href=index.asp>登陆</a> 
      </div>
    </td>
  </tr>
  <tbody> </tbody> 
</table>
<!-- #Include File=../foot.inc -->
<%
end sub 
'================================================
'程序制做:迅捷网络.          http://www.soonhost.com
'迅捷主机网 -- 域名注册、主机租用、网站建设、脚本开发
'网址:http://www.soonhost.com
'msn:soonhost@hotmail.com
'请保留以上版权信息,谢谢合作!
'================================================
%>

⌨️ 快捷键说明

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