?? profile.asp
字號:
<!--#include file="MarcosCB.asp"-->
<%
getConn()
isIn()
dim i,userId
dim theAct,strOther
dim str,pageCode,pageTitle,pageOther
dim userPic,userName,passWord,conPassWord,userSign,userSex,userBirthday,userGroup
theAct=getPost("theAct")
userId=getPost("userId")
userName=replace(getPost("userName"),"'","''")
if not isNumeric(userId) then
userId=getValue("userId")
end if
if userId<>getValue("userId") then
isAdmin()
end if
nowWhere "修改個人資料","proFile.asp"
if theAct="modify" then
passWord=getPost("passWord")
conPassWord=getPost("conPassWord")
userPic=getPost("userPic")
userSign=getPost("userSign")
userSex=getPost("userSex")
userBirthday=getPost("userBirthday")
userGroup=getPost("userGroup")
if passWord<>conPassWord then
echo "<script>alert('密碼確認錯誤!');history.back();</script>"
closeConn()
response.end
end if
if not isDate(userBirthday) then
echo "<script>alert('對不起,您的生日填寫錯誤!');history.back();</script>"
closeConn()
response.end
end if
sql="select * from Marcos_User where userId="&userId
rs.open sql,conn,1,3
' rs("userName")=userName
rs("userSign")=userSign
rs("userPic")=userPic
rs("userSex")=userSex
rs("userBirthday")=userBirthday
rs("userGroup")=userGroup
if passWord<>"" then
rs("passWord")=md5(passWord)
if userId=getValue("userId") then
setValue "passWord",md5(passWord)
end if
end if
for i=1 to request("otherValue").count
if request("otherName")(i)<>"" and request("otherValue")(i)<>"" then
strOther=strOther & request("otherName")(i) & "@@" & request("otherValue")(i) & "$$$"
end if
next
rs("userOther")=strOther
rs.update
rs.close
echo "<script>alert('修改成功!');location.href='proFile.asp?userId="&userId&"';</script>"
closeConn()
response.end
end if
rem =========================== 頁面顯示代碼 ====================================
str=getMainCode(mySkinId)
pageTitle="<a href=javascript:location.reload();>修改我的資料</a>"
pageOther="<script>document.title+=' - 修改我的資料';</script>"
showHead str,pageTitle,pageOther
showBody()
showFoot(str)
sub showBody()
pageCode=getPageCode(mySkinId,"PageProFile")
PageProFile=split(pageCode,"$$$")
body=PageProFile(0)
sql="select * from Marcos_User where userId="&userId
rs.open sql,conn,1,1
body=replace(body,"{$userName}",rs("userName"))
body=replace(body,"{$userId}",rs("userId"))
body=replace(body,"{$userSex"&rs("userSex")&"}","checked")
body=replace(body,"{$userBirthday}",rs("userBirthday"))
body=replace(body,"{$userGroup}",rs("userGroup"))
body=replace(body,"{$userPic}",fixNull(rs("userPic")))
userOther=split(fixNull(rs("userOther")),"$$$")
for i=0 to uBound(userOther)-1
body=body&PageProFile(1)
body=replace(body,"{$otherName}",split(userOther(i),"@@")(0))
body=replace(body,"{$otherValue}",split(userOther(i),"@@")(1))
next
body=body&PageProFile(2)
body=replace(body,"{$userSign}",fixNull(rs("userSign")))
echo body
rs.close
queryTimes=queryTimes+1
end sub
closeConn()
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -