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

📄 mymodify.asp

📁 生活者姿态整站程序 生活者姿态整站程序 生活者姿态整站程序
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="chkuser.asp" -->
<!--#include file="inc/char.asp"-->
<!--#include file="inc/theme.asp"-->
<!--#include file="md5.asp"-->
<%
stats="修改资料"
if membername="" then
  	errmsg=errmsg+"<br>"+"<li>您没有<a href=login.asp target=_blank>登录</a>。"
	founderr=true
else
	if request("action")="update" then
		if request("sex")="" then
			errmsg=errmsg+"<br>"+"<li>请选择您的性别。"
			founderr=true
		elseif request("sex")=0 or request("sex")=1 then
			sex=request("sex")
		else
			errmsg=errmsg+"<br>"+"<li>您输入的字符非法。"
			founderr=true
		end if
		
		if request("showRe")="" then
			errmsg=errmsg+"<br>"+"<li>请选择有回帖时是否提示您。"
			founderr=true
		elseif request("showRe")=0 or request("showRe")=1 then
			showRe=request("showRe")
		else
			errmsg=errmsg+"<br>"+"<li>您输入的字符非法。"
			founderr=true
		end if
				
		if request("psw")="" then
		  	errmsg=errmsg+"<br>"+"<li>请输入您的密码。"
			founderr=true
		elseif trim(request("psw"))=trim(memberword) then
			password=request("psw")
		else
			password=md5(request("psw"))
		end if
		if request("quesion")="" then
		  	errmsg=errmsg+"<br>"+"<li>请输入密码提示问题。"
			founderr=true
		else
		quesion=request("quesion")
		end if
		if request("answer")="" then
		  	errmsg=errmsg+"<br>"+"<li>请输入密码提示问题答案。"
			founderr=true
		elseif request("answer")=request("oldanswer") then
			answer=request("answer")
		else
		answer=md5(request("answer"))
		end if
		if request("myface")<>"" then
			if request("width")="" or request("height")="" then
				errmsg=errmsg+"<br>"+"<li>请输入图片的宽度和高度。"
				founderr=true
			elseif not isInteger(request("width")) or not isInteger(request("height")) then
				errmsg=errmsg+"<br>"+"<li>您输入的字符不合法。"
				founderr=true
			elseif request("width")<20 or request("width")>80 then
				errmsg=errmsg+"<br>"+"<li>您输入的图片宽度不符合标准。"
				founderr=true
			elseif request("height")<20 or request("height")>80 then
				errmsg=errmsg+"<br>"+"<li>您输入的图片高度不符合标准。"
				founderr=true
			else
				face=request("myface")
				width=request("width")
				height=request("height")
			end if
		else
			if request("face")="" then
				errmsg=errmsg+"<br>"+"<li>请选择您的个性头像。"
				founderr=true
			elseif Instr(request("face"),picurl)>0 then
				face=request("face")
				width=32
				height=32
			else
				errmsg=errmsg+"<br>"+"<li>您选择了错误的头像。"
				founderr=true
			end if
		end if
		if IsValidEmail(request("Email"))=false then
   			errmsg=errmsg+"<br>"+"<li>您的Email有错误。"
   			founderr=true
		else
			Email=request("Email")
		end if
		if request("oicq")<>"" then
			if not isnumeric(request("oicq")) or len(request("oicq"))>10 then
			errmsg=errmsg+"<br>"+"<li>Oicq号码只能是4-10位数字,您可以选择不输入。"
			founderr=true
			end if
		end if
		if request.Form("birthyear")="" or request.form("birthmonth")="" or request.form("birthday")="" then
		birthday=""
		else
		birthday=trim(Request.Form("birthyear"))&"-"&trim(Request.Form("birthmonth"))&"-"&trim(Request.Form("birthday"))
		end if
	else
		call nav()
		call headline(1)
		call userinfo()
	end if
end if

if founderr then
	call nav()
	call headline(1)
	call error()
else
	if request("action")="update" then
		if founderr then
			call nav()
			call headline(1)
			call error()
		else
			call update()
			call nav()
			call headline(1)
			if founderr then
			call error()
			else
			call success()
			end if
		end if
	end if
end if
call endline()

sub userinfo()
	set rs=server.createobject("adodb.recordset")
	sql="Select * from [User] where username='"&trim(membername)&"'"
	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
		founderr=true
	else
%>
<form action="mymodify.asp?action=update&username=<%=htmlencode(membername)%>" method=POST name="theForm">
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=Tablebackcolor%> align=center>
        <tr>
            <td>
                <table cellpadding=3 cellspacing=1 border=0 width=100%>
    <tr align="center"> 
      <td colspan="2" width="100%" bgcolor=<%=Tabletitlecolor%> height=25><font color="<%=TablefontColor%>"><b><%=htmlencode(RS("username"))%>修改资料</b></font></td>
    </tr>
      <tr bgcolor=<%=Tablebodycolor%>>    
        <td width="40%"><font color="<%=TableContentColor%>"><B>性别</B>:<BR>请选择您的性别</font></td>   
        <td width="60%"><input type="radio" value="1"<%if rs("sex")=1 then%> checked <%end if%>name="Sex">酷哥
      <input type="radio" name="Sex"<%if rs("sex")=0 then%> checked <%end if%> value="0">靓妹</td>
</td>   
      </tr>   
      <tr bgcolor=<%=Tablebodycolor%>>    
        <td width="40%"><font color="<%=TableContentColor%>"><B>密码</B>:<BR>如要修改请直接输入</font></td>   
        <td width="60%">    
          <input type="password" name="psw" value="<%=htmlencode(RS("userpassword"))%>" size=30 maxlength=13>   
        </td>   
      </tr>   
      <tr bgcolor=<%=Tablebodycolor%>>    
        <td width="40%"><font color="<%=TableContentColor%>"><B>密码问题</B>:<BR>请填写做为密码答案依据</font></td>   
        <td width="60%">    
          <input type=text name="quesion" size=30 value="<%=htmlencode(rs("quesion"))%>">
        </td>   
      </tr>  
      <tr bgcolor=<%=Tablebodycolor%>>    
        <td width="40%"><font color="<%=TableContentColor%>"><B>问题答案</B>:<BR>请认真填写以便您日后取回密码<BR>答案采用了MD5加密,只供取回密码使用,如要修改可直接填写。</font></td>   
        <td width="60%">    
          <input type=text name="answer" size=30 value="<%=htmlencode(rs("answer"))%>">
          <input type=hidden name="oldanswer" value="<%=htmlencode(rs("answer"))%>">
        </td>   
      </tr>  
      <tr bgcolor=<%=Tablebodycolor%>>    
        <td width="40%"><font color="<%=TableContentColor%>"><B>Email地址</B>:<BR>请输入有效的邮件地址,这将保证您在论坛中的私人资料。</font></td>   
        <td width="60%">    
          <input type="TEXT" name="Email" size=30 maxlength=50 value="<%if trim(rs("useremail"))<>"" then%><%=htmlencode(rs("useremail"))%><%end if%>">   
        </td>   
      </tr>   
      <tr bgcolor=<%=Tablebodycolor%>>    
        <td width="40%"><font color="<%=TableContentColor%>"><B>生日</B><BR>如不想填写,请全部留空</font></td>   
        <td width="60%"> <font color="<%=TableContentColor%>">   
				  <select name=birthyear>
				  <option value=""></option>
				  <%for i=1901 to 2000%>
					<option value="<%=i%>" <%if not isnull(rs("birthday")) or rs("birthday")<>"" then%><%if cint(year(rs("birthday")))=cint(i) then response.write "selected"%><%end if%>><%=i%></option>
				  <%next%>
				  </select>
				  <select name=birthmonth>
				  <option value=""></option>
				  <%for i=1 to 12%>
					<option value="<%=i%>" <%if not isnull(rs("birthday")) or rs("birthday")<>"" then%><%if cint(month(rs("birthday")))=cint(i) then response.write "selected"%><%end if%>><%=i%></option>
				  <%next%>
				  </select>
				  <select name=birthday>
				  <option value=""></option>
				  <%for i=1 to 31%>
					<option value="<%=i%>" <%if not isnull(rs("birthday")) or rs("birthday")<>"" then%><%if cint(day(rs("birthday")))=cint(i) then response.write "selected"%><%end if%>><%=i%></option>
				  <%next%>
				  </select>
                    日</font>
        </td>   
      </tr>
<%if cint(TitleFlag)=1 then%>
<%if rs("userclass")>5 then%>
      <tr bgcolor=<%=Tablebodycolor%>> 
        <td width="40%"><font color="<%=TableContentColor%>"><B>头衔</B>:</font></td>   
        <td width="60%"> <input type="text" name="title" value="<%if trim(rs("title"))<>"" then%><%=htmlencode(RS("title"))%><%end if%>" size=15 maxlength=13> </td>   
      </tr>   
<%end if%>
<%end if%>
      <tr bgcolor=<%=Tablebodycolor%>>    
        <td width="40%" valign=top><font color="<%=TableContentColor%>"><B>头像</B>:<BR>
您可以选择一个个性图片,当你发表时将显示在您的名字下方。<BR>
如果你填写了下面的自定义头像部分,那么你的头像以自定义的为准。否则,请你留空自定义头像的所有栏目!<BR>
<B>关于自定义头像</B>:<BR>

⌨️ 快捷键说明

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