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

📄 mymodify.asp

📁 功能强大的一个b/s工作站
💻 ASP
📖 第 1 页 / 共 3 页
字号:
</tr>
<tr>
<td valign=top width=40% class=tablebody1> <b>婚姻状况:</b>
<select size=1 name=marital>
<option <%if marital="" then%>selected<%end if%>></option>
<option value=未婚 <%if marital="未婚" then%>selected<%end if%>>未婚</option>
<option value=已婚 <%if marital="已婚" then%>selected<%end if%>>已婚</option>
<option value=离异 <%if marital="离异" then%>selected<%end if%>>离异</option>
<option value=丧偶 <%if marital="丧偶" then%>selected<%end if%>>丧偶</option>
</select></td>
</tr>
<tr>
<td valign=top width=40% class=tablebody1> <b>最高学历:</b>
<select size=1 name=education>
<option <%if education="" then%>selected<%end if%>></option>
<option value=小学 <%if education="小学" then%>selected<%end if%>>小学</option>
<option value=初中 <%if education="初中" then%>selected<%end if%>>初中</option>
<option value=高中 <%if education="高中" then%>selected<%end if%>>高中</option>
<option value=大学 <%if education="大学" then%>selected<%end if%>>大学</option>
<option value=硕士 <%if education="硕士" then%>selected<%end if%>>硕士</option>
<option value=博士 <%if education="博士" then%>selected<%end if%>>博士</option>
</select></td>
</tr>
<tr>
<td valign=top width=40% class=tablebody1> <b>毕业院校:</b>
<input type=text name=college size=18 value="<%=college%>"></td>
</tr>

    <tr align="center"> 
      <td colspan="2" width="100%" class=tablebody2>
            <input type=Submit value="更 新" name="Submit"> &nbsp; <input type="reset" name="Submit2" value="清 除">
      </td>
    </tr>  
    </table></form>
   
</body>
</html> 
<%
end if
rs.close
set rs=nothing
end sub

sub update()
dim CanUseTitle,CanUseTitle1,CanUseTitle2
Dim SplitUserTitle
CanUseTitle=false
CanUseTitle1=false
CanUseTitle2=false
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("myface")<>"" and ((Cint(forum_setting(54))>0 and myarticle>Cint(forum_setting(54))) or Cint(forum_setting(54))=0) 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 Cint(request("width"))>Cint(forum_setting(57)) then
		errmsg=errmsg+"<br>"+"<li>您输入的图片宽度不符合标准。"
		founderr=true
	elseif Cint(request("height"))>Cint(forum_setting(57)) then
		errmsg=errmsg+"<br>"+"<li>您输入的图片高度不符合标准。"
		founderr=true
	else
		if Cint(forum_setting(55))=0 then
			if instr(lcase(request("myface")),"http://")>0 or instr(lcase(request("myface")),"www.")>0 then
				errmsg=errmsg+"<br>"+"<li>本论坛设置了不允许连接外部网址做头像。"
				founderr=true
			end if
		end if
		face=request("myface")
		width=request("width")
		height=request("height")
	end if
else
	if request("face")="" then
		errmsg=errmsg+"<br>"+"<li>请选择您的个性头像。"
		founderr=true
	else
		face=request("face")
	end if
end if
if width="" or height="" then
width=forum_setting(38)
height=forum_setting(39)
end if

if strLength(request("Signature"))>250 then
	errmsg=errmsg+"<br>"+"<li>签名只能在250个字符以内。"
	founderr=true
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"))
	if not isdate(birthday) then birthday=""
end if

dim userinfo,usersetting
userinfo=checkreal(request.Form("realname")) & "|||" & checkreal(request.Form("character")) & "|||" & checkreal(request.Form("personal")) & "|||" & checkreal(request.Form("country")) & "|||" & checkreal(request.Form("province")) & "|||" & checkreal(request.Form("city")) & "|||" & request.Form("shengxiao") & "|||" & request.Form("blood") & "|||" & request.Form("belief") & "|||" & request.Form("occupation") & "|||" & request.Form("marital") & "|||" & request.Form("education") & "|||" & checkreal(request.Form("college")) & "|||" & checkreal(request.Form("userphone")) & "|||" & checkreal(request.Form("address"))
usersetting=request.Form("setuserinfo") & "|||" & request.Form("setusertrue")

set rs=server.createobject("adodb.recordset")
sql="Select * from [User] where userid="&userid
rs.open sql,conn,1,3
if rs.eof and rs.bof then
	errmsg=errmsg+"<br>"+"<li>该用户名不存在。"
	founderr=true
else
	rs("face")=face
	rs("width")=width
	rs("height")=height
	rs("sex")=sex
	rs("sign")=trim(request("Signature"))
	rs("userphoto")=request("userphoto")
	rs("showRe")=showRe
	rs("UserGroup")=request("groupname")
	'判断是否允许提交头衔
	if Cint(Forum_Setting(6))=1 then
		CanUseTitle=true
	end if
	if CanUseTitle and Cint(forum_setting(60))>0 and rs("article")>Cint(forum_setting(60)) then
		CanUseTitle1=true
	elseif CanUseTitle and Cint(forum_setting(60))=0 then
		CanUseTitle1=true
	else
		CanUseTitle1=false
	end if
	if CanUseTitle and Cint(forum_setting(61))>0 and DateDiff("d",rs("AddDate"),Now())>Cint(forum_setting(61)) then
		CanUseTitle2=true
	elseif CanUseTitle and Cint(forum_setting(61))=0 then
		CanUseTitle2=true
	else
		CanUseTitle2=false
	end if
	if CanUseTitle and Cint(forum_setting(62))=1 then
		if CanUseTitle1 and CanUseTitle2 then
			CanUseTitle=true
		else
			CanUseTitle=false
		end if
	elseif CanUseTitle and (CanUseTitle1 or CanUseTitle2) then
		CanUseTitle=true
	else
		CanUseTitle=false
	end if
	if request("title")<>"" and CanUseTitle then
		if trim(forum_setting(63))<>"" then
		SplitUserTitle=split(forum_setting(63),"|")
		for i=0 to ubound(SplitUserTitle)
			if instr(lcase(request("title")),lcase(SplitUserTitle(i)))>0 then
				Errmsg=Errmsg + "<br>" + "<li>您设定的头衔中包含了系统禁止使用的字符"
				FoundErr=true
				exit sub
			end if
		next
		end if
		if len(request("title"))>Cint(forum_setting(59)) then
			Errmsg=Errmsg + "<br>" + "<li>您设置的头衔超过了本论坛允许的长度,头衔最大长度为"&forum_setting(59)&"字节。"
			FoundErr=true
			exit sub
		end if
		rs("title")=htmlencode(request("title"))
	end if
	if birthday<>"" then
		rs("birthday")=birthday
	end if
	rs("userinfo")=userinfo
	rs("usersetting")=usersetting
	rs("bbstype")=request("bbstype")
	rs.Update
	usercookies=request("usercookies")
	select case usercookies
	case 0
		Response.Cookies("aspsky")("usercookies") = usercookies
	case 1
		Response.Cookies("aspsky").Expires=Date+1
		Response.Cookies("aspsky")("usercookies") = usercookies
	case 2
		Response.Cookies("aspsky").Expires=Date+31
		Response.Cookies("aspsky")("usercookies") = usercookies
	case 3
		Response.Cookies("aspsky").Expires=Date+365
		Response.Cookies("aspsky")("usercookies") = usercookies
	end select			
		
	Response.Cookies("aspsky")("tempid") = request("bbstype")
	Response.Cookies("aspsky").path=cookiepath
end if
rs.close
set rs=nothing
'******************
'对上传头象进行过滤与改名
if Cint(Forum_Setting(7))=1 then 
	on error resume next
    dim objFSO,upfilename,newfilename
    dim upface,memberid
    set rs=conn.execute("select userid,face from [user] where userid="&userid)
    memberid=rs(0)
    upface=trim(rs(1))
    newfilename=""
	upfilename=split(upface,"/")
	if ubound(upfilename)=1 and upfilename(0)="uploadFace"  then
		if  instr(upfilename(1),"_")=0 then
			newfilename="uploadFace/"&memberid&"_"&upfilename(1)
			Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
			if objFSO.fileExists(Server.MapPath(upface)) then
				objFSO.movefile ""&Server.MapPath(upface)&"",""&Server.MapPath(newfilename)&""
			end if
			If Err.Number = 0 Then
				conn.execute("update [user] set face='"&newfilename&"' where userid="&userid)
			end if
			set objFSO=nothing
		end if
	end if
	rs.close
	set rs=nothing
end if
'对上传头象进行过滤与改名结束
'****************
end sub

function checkreal(v)
dim w
if not isnull(v) then
	w=replace(v,"|||","§§§")
	checkreal=w
end if
end function
%>

⌨️ 快捷键说明

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