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

📄 mymodify.asp

📁 1、为了界面的美观性考虑
💻 ASP
📖 第 1 页 / 共 2 页
字号:
  theKidney=split(KidneyType, ",")
	   for i = 0 to ubound(theKidney)	
	   response.write "<input type=""checkbox"" name=""character"" value="""&trim(theKidney(i))&""" "
	 
	       if instr(character,trim(theKidney(i)))>0 then '如果有此项性格
		   response.write "checked" 
		   end if
	  
	   response.write ">"&trim(theKidney(i))&" "
	   if ((i+1) mod 5)=0 then response.write "<br>"  '每行显示六个性格进行换行
	   next   
  %>
</td>
</tr>
<tr>
<td class=tablebody1><b>个人简介: &nbsp;</b><br>
<textarea name=personal rows=6 cols=90% ><%=personal%></textarea>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign=top width=40%  class=tablebody1> <b>国  家:</b>
<b>
<input type=text name=country size=18 value="<%=country%>">
</b> </td>
</tr>
<tr>
<td valign=top width=40%  class=tablebody1> <b>联系电话:</b>
<b>
<input type=text name=userphone size=18 value="<%=userphone%>">
</b> </td>
</tr>
<tr>
<td valign=top width=40% class=tablebody1> <b>通信地址:</b>
<b>
<input type=text name=address size=18 value="<%=address%>">
</b> </td>
</tr>
<tr>
<td valign=top width=40% class=tablebody1> <b>省  份:</b>
<input type=text name=province size=18 value="<%=province%>">
</td>
</tr>
<tr>
<td valign=top width=40% class=tablebody1> <b>城  市:
</b>
<input type=text name=city size=18 value="<%=city%>">
</td>
</tr>
<tr>
<td valign=top width=40% class=tablebody1> <b>生  肖:
</b>
<select size=1 name=shengxiao>
<option <%if shengxiao="" then%>selected<%end if%>></option>
<option value=鼠 <%if shengxiao="鼠" then%>selected<%end if%>>鼠</option>
<option value=牛 <%if shengxiao="牛" then%>selected<%end if%>>牛</option>
<option value=虎 <%if shengxiao="虎" then%>selected<%end if%>>虎</option>
<option value=兔 <%if shengxiao="兔" then%>selected<%end if%>>兔</option>
<option value=龙 <%if shengxiao="龙" then%>selected<%end if%>>龙</option>
<option value=蛇 <%if shengxiao="蛇" then%>selected<%end if%>>蛇</option>
<option value=马 <%if shengxiao="马" then%>selected<%end if%>>马</option>
<option value=羊 <%if shengxiao="羊" then%>selected<%end if%>>羊</option>
<option value=猴 <%if shengxiao="猴" then%>selected<%end if%>>猴</option>
<option value=鸡 <%if shengxiao="鸡" then%>selected<%end if%>>鸡</option>
<option value=狗 <%if shengxiao="狗" then%>selected<%end if%>>狗</option>
<option value=猪 <%if shengxiao="猪" then%>selected<%end if%>>猪</option>
</select>
</td>
</tr>
<tr>
<td valign=top width=40% class=tablebody1> <b>血  型:</b>
<select size=1 name=blood>
<option <%if blood="" then%>selected<%end if%>></option>
<option value=A <%if blood="A" then%>selected<%end if%>>A</option>
<option value=B <%if blood="B" then%>selected<%end if%>>B</option>
<option value=AB <%if blood="AB" then%>selected<%end if%>>AB</option>
<option value=O <%if blood="O" then%>selected<%end if%>>O</option>
<option value=其他 <%if blood="其他" then%>selected<%end if%>>其他</option>
</select>
</td>
</tr>
<tr>
<td valign=top width=40% class=tablebody1> <b>信  仰:</b>
<select size=1 name=belief>
<option <%if belief="" then%>selected<%end if%>></option>
<option value=佛教 <%if belief="佛教" then%>selected<%end if%>>佛教</option>
<option value=道教 <%if belief="道教" then%>selected<%end if%>>道教</option>
<option value=基督教 <%if belief="基督教" then%>selected<%end if%>>基督教</option>
<option value=天主教 <%if belief="天主教" then%>selected<%end if%>>天主教</option>
<option value=回教 <%if belief="回教" then%>selected<%end if%>>回教</option>
<option value=无神论者 <%if belief="无神论者" then%>selected<%end if%>>无神论者</option>
<option value=共产主义者 <%if belief="共产主义者" then%>selected<%end if%>>共产主义者</option>
<option value=其他 <%if belief="其他" then%>selected<%end if%>>其他</option>
</select></td>
</tr>
<tr>
<td valign=top width=40% class=tablebody1> <b>职  业: </b>
<select name=occupation>
<option <%if occupation="" then%>selected<%end if%>> </option>
<option value="财会/金融" <%if occupation="财会/金融" then%>selected<%end if%>>财会/金融</option>
<option value=工程师 <%if occupation="工程师" then%>selected<%end if%>>工程师</option>
<option value=顾问 <%if occupation="顾问" then%>selected<%end if%>>顾问</option>
<option value=计算机相关行业 <%if occupation="计算机相关行业" then%>selected<%end if%>>计算机相关行业</option>
<option value=家庭主妇 <%if occupation="家庭主妇" then%>selected<%end if%>>家庭主妇</option>
<option value="教育/培训" <%if occupation="教育/培训" then%>selected<%end if%>>教育/培训</option>
<option value="客户服务/支持" <%if occupation="客户服务/支持" then%>selected<%end if%>>客户服务/支持</option>
<option value="零售商/手工工人" <%if occupation="零售商/手工工人" then%>selected<%end if%>>零售商/手工工人</option>
<option value=退休 <%if occupation="退休" then%>selected<%end if%>>退休</option>
<option value=无职业 <%if occupation="无职业" then%>selected<%end if%>>无职业</option>
<option value="销售/市场/广告" <%if occupation="销售/市场/广告" then%>selected<%end if%>>销售/市场/广告</option>
<option value=学生 <%if occupation="学生" then%>selected<%end if%>>学生</option>
<option value=研究和开发 <%if occupation="研究和开发" then%>selected<%end if%>>研究和开发</option>
<option value="一般管理/监督" <%if occupation="一般管理/监督" then%>selected<%end if%>>一般管理/监督</option>
<option value="政府/军队" <%if occupation="政府/军队" then%>selected<%end if%>>政府/军队</option>
<option value="执行官/高级管理" <%if occupation="执行官/高级管理" then%>selected<%end if%>>执行官/高级管理</option>
<option value="制造/生产/操作" <%if occupation="制造/生产/操作" then%>selected<%end if%>>制造/生产/操作</option>
<option value=专业人员 <%if occupation="专业人员" then%>selected<%end if%>>专业人员</option>
<option value="自雇/业主" <%if occupation="自雇/业主" then%>selected<%end if%>>自雇/业主</option>
<option value=其他 <%if occupation="其他" then%>selected<%end if%>>其他</option>
</select></td>
</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")=replace(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='"&replace(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 + -