?? changeinfo.asp
字號:
<!--#include file="config.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/chkinput.asp"-->
<!--#include file="../api/cls_api.asp"-->
<!--#include file="head.inc"-->
<%
Call InnerLocation("修改會員資料")
Dim Rs,SQL
If CInt(GroupSetting(1)) = 0 Then
ErrMsg = ErrMsg + "<li>對不起!您沒有修改用戶資料的權(quán)限,如有什么問題請聯(lián)系管理員。</li>"
Founderr = True
ElseIf LCase(Request("action")) = "save" Then
Call ChangeUserInfo
Else
Set Rs = Newasp.Execute("SELECT * FROM [NC_User] WHERE username='" & Newasp.membername & "' And userid=" & Newasp.memberid)
If (Rs.bof And Rs.EOF) Then
ErrMsg = ErrMsg + "<li>Sorry!錯誤的系統(tǒng)參數(shù)!</li>"
Founderr = True
Else
%>
<script language="JavaScript">
<!--
function checkForm() {
if (document.myform.password.value.length == 0) {
alert("請輸入您的用戶密碼!");
document.myform.password.focus();
return false;
}
if (document.myform.nickname.value.length == 0) {
alert("請輸入您的用戶昵稱!");
document.myform.nickname.focus();
return false;
}
if (document.myform.codestr.value.length != 4) {
alert("驗證碼輸入有誤!");
document.myform.codestr.focus();
return false;
}
if (document.myform.usermail.value.length == 0) {
alert("請輸入您的E-mail");
document.myform.usermail.focus();
return false;
}
return true;
}
//-->
</script>
<table cellspacing=1 align=center cellpadding=2 bgcolor=#cccccc border=0 class=Usertableborder>
<tr>
<th colspan=2>修改個人資料</th>
</tr>
<form method="post" name=myform action="?action=save" onsubmit="return checkForm();">
<tr>
<td align=right width="25%" class=Usertablerow1 height=20>用戶名:</td>
<td width="75%" class=Usertablerow1> <strong class=userfont1><%=Newasp.membername%></strong>
<input type=hidden name=username value="<%=Server.HTMLEncode(Rs("username"))%>"><input type=hidden name=userid value="<%=Newasp.memberid%>"></td>
</tr>
<tr>
<td align=right class=Usertablerow2 height=20>用戶昵稱(<span class=userfont1>*</span>):</td>
<td class=Usertablerow2> <input class=inputbody type=text size=20 name=nickname value="<%=Newasp.HTMLEncodes(Rs("nickname"))%>" maxlength="15"></td>
</tr>
<tr>
<td align=right class=Usertablerow1 height=20>真實姓名(<span class=userfont1>*</span>):</td>
<td class=Usertablerow1> <input class=inputbody type=text size=20 name=TrueName value="<%=Newasp.HTMLEncodes(Rs("TrueName"))%>" maxlength="15"></td>
</tr>
<tr bgcolor=#ffffff>
<td align=right class=Usertablerow2 height=20> 用戶郵箱(<span class=userfont1>*</span>):</td>
<td class=Usertablerow2> <input type=text class=inputbody size=30 name=usermail value="<%=Newasp.HTMLEncodes(Rs("usermail"))%>" maxlength="50"> <span class=userfont1>注意:</span><font color=#808080>請?zhí)顚懩愠S玫泥]箱</font></td>
</tr>
<tr>
<td align=right class=Usertablerow1 height=20>性別:</td>
<td class=Usertablerow1> <input type=radio name=usersex value="男"<%If Trim(Rs("usersex")) = "男" Then Response.Write " checked"%>> 男
<input type=radio name=usersex value="女"<%If Trim(Rs("usersex")) = "女" Then Response.Write " checked"%>> 女
<input type=radio name=usersex value="女"<%If Trim(Rs("usersex")) = "保密" Then Response.Write " checked"%>> 保密</td>
</tr>
<tr>
<td align=right class=Usertablerow2 height=20>密碼提示問題(<span class=userfont1>*</span>):</td>
<td class=Usertablerow2> <input class=inputbody type=text size=30 name=question value="<%=Newasp.HTMLEncodes(Rs("question"))%>" maxlength="35"> <select onChange="question.value=this.value;")>
<option value="" selected>[請選擇]</option>
<option value="最喜歡的寵物?">最喜歡的寵物?</option>
<option value="最喜愛的電影?">最喜愛的電影?</option>
<option value="周年紀念日 [年/月/日]?">周年紀念日 [年/月/日]?</option>
<option value="父親的名字?">父親的名字?</option>
<option value="配偶的名字?">配偶的名字?</option>
<option value="第一個孩子的愛稱?">第一個孩子的愛稱?</option>
<option value="中學的校名?">中學的校名?</option>
<option value="最尊敬的老師?">最尊敬的老師?</option>
<option value="最喜歡的運行隊?">最喜歡的運行隊?</option>
</select></td>
</tr>
<tr>
<td align=right class=Usertablerow1 height=20>密碼問題答案:</td>
<td class=Usertablerow1> <input class=inputbody type=text size=30 name=answer maxlength="35"> <font color=#808080>忘記密碼的提示問題答案,用于取回密碼</font></td>
</tr>
<tr bgcolor=#ffffff>
<td align=right class=Usertablerow2 height=20>聯(lián)系電話:</td>
<td class=Usertablerow2> <input type=text class=inputbody size=20 name=phone value="<%=Newasp.HTMLEncodes(Rs("phone"))%>" maxlength="20"> <font color=#808080>如:+86-27-85188888</font></td>
</tr>
<tr>
<td align=right class=Usertablerow1 height=20>你的OICQ:</td>
<td class=Usertablerow1> <input class=inputbody type=text size=20 name=oicq value="<%=Newasp.HTMLEncodes(Rs("oicq"))%>" maxlength="20"></td>
</tr>
<tr bgcolor=#ffffff>
<td align=right class=Usertablerow2 height=20>郵政編碼:</td>
<td class=Usertablerow2> <input type=text class=inputbody size=20 name=postcode value="<%=Newasp.HTMLEncodes(Rs("postcode"))%>" maxlength="20"></td>
</tr>
<tr>
<td align=right class=Usertablerow1 height=20>身份證:</td>
<td class=Usertablerow1> <input class=inputbody type=text size=30 name=UserIDCard value="<%=Newasp.HTMLEncodes(Rs("UserIDCard"))%>" maxlength="35"></td>
</tr>
<tr bgcolor=#ffffff>
<td align=right class=Usertablerow2 height=20>聯(lián)系地址:</td>
<td class=Usertablerow2> <input type=text class=inputbody size=50 name=address value="<%=Newasp.HTMLEncodes(Rs("address"))%>" maxlength="50"></td>
</tr>
<tr>
<td align=right class=Usertablerow1 height=20>交易密碼:</td>
<td class=Usertablerow1> <input class=inputbody type=text size=30 name=BuyCode maxlength="35"> <font color=#808080>站內(nèi)支付所用的交易密碼</font></td>
</tr>
<tr>
<td align=right class=Usertablerow2 height=20>個人主頁:</td>
<td class=Usertablerow2> <input class=inputbody type=text size=30 name=HomePage value="<%=Newasp.HTMLEncodes(Rs("HomePage"))%>" maxlength="35"> <font color=#808080>以“http://”開頭</font></td>
</tr>
<tr>
<td align=right class=Usertablerow1 height=20>用戶密碼:</td>
<td class=Usertablerow1> <input class=inputbody type=password size=30 name=password value="" maxlength="50"> <span class=userfont1>輸入正確的密碼才能修改用戶資料</span></td>
</tr>
<tr>
<td align=right class=Usertablerow2 height=20>驗 證 碼:</td>
<td class=Usertablerow2> <input class=inputbody type=text size=6 name=codestr maxlength="6"> <img src="../inc/getcode.asp" alt="驗證碼,看不清楚?請點擊刷新驗證碼" onclick="this.src='../inc/getcode.asp'"> <font color=#808080>請輸入驗證碼</font></td>
</tr>
<tr>
<td align=middle class=Usertablerow2 height=20> </td>
<td class=Usertablerow2 align=center><input type=submit value=" 確 認 " name="submit" class="button"></td>
</tr></form>
</table>
<%
End If
Rs.Close:Set Rs = Nothing
End If
If Founderr = True Then
Call Returnerr(ErrMsg)
End If
Sub ChangeUserInfo()
On Error Resume Next
Dim username, password,userid
Dim usersex,sex
username = Newasp.CheckBadstr(Newasp.membername)
userid = Newasp.ChkNumeric(memberid)
If Newasp.CheckPost=False Then
ErrMsg = ErrMsg + Postmsg
FoundErr = True
Exit Sub
End If
If Newasp.IsValidPassword(Request.Form("answer")) = False And Trim(Request.Form("answer")) <> "" Then
ErrMsg = ErrMsg + "<li>密碼問題答案中含有非法字符!</li>"
Founderr = True
End If
If Trim(Request.Form("username")) <> username Then
ErrMsg = ErrMsg + "<li>非法操作!</li>"
Founderr = True
End If
If Trim(Request.Form("password")) = "" Then
ErrMsg = ErrMsg + "<li>請輸入用戶密碼!</li>"
Founderr = True
Else
password = md5(Request.Form("password"))
End If
If userid = 0 Then
FoundErr = True
ErrMsg = ErrMsg + "<li>Sorry!您選擇了錯誤的系統(tǒng)參數(shù)。</li>"
Exit Sub
End If
If Trim(Request.Form("nickname")) = "" Then
ErrMsg = ErrMsg + "<li>用戶昵稱不能為空!</li>"
Founderr = True
End If
If Newasp.IsValidStr(Request.Form("nickname")) = False Then
ErrMsg = ErrMsg + "<li>用戶昵稱中含有非法字符!</li>"
Founderr = True
End If
If Trim(Request.Form("TrueName")) = "" Then
ErrMsg = ErrMsg + "<li>真實姓名不能為空!</li>"
Founderr = True
End If
If Newasp.IsValidStr(Request.Form("TrueName")) = False Then
ErrMsg = ErrMsg + "<li>真實姓名中含有非法字符!</li>"
Founderr = True
End If
If Trim(Request.Form("usermail")) = "" Then
ErrMsg = ErrMsg + "<li>您的Email不能為空!</li>"
Founderr = True
End If
If IsValidEmail(Request.Form("usermail")) = False Then
ErrMsg = ErrMsg + "<li>您的Email有錯誤!</li>"
Founderr = True
End If
If Not IsNumeric(Request.Form("oicq")) And Trim(Request.Form("oicq")) <> "" Then
FoundErr = True
ErrMsg = ErrMsg + "<li>QQ號碼請用數(shù)字填寫。</li>"
End If
If Trim(Request.Form("HomePage")) <> "" And Left(Request.Form("HomePage"),7) <> "http://" Then
FoundErr = True
ErrMsg = ErrMsg + "<li>個人主頁地址輸入有誤,請以“http://”開頭。</li>"
End If
If Not Newasp.CodeIsTrue() Then
ErrMsg = ErrMsg + "<meta http-equiv=""refresh"" content=""2;URL=changeinfo.asp""><li>驗證碼校驗失敗,請返回刷新頁面再試。兩秒后自動返回</li>"
Session("GetCode") = ""
Founderr = True
Exit Sub
End If
Session("GetCode") = ""
If Trim(Request.Form("usersex")) = "" Then
ErrMsg = ErrMsg + "<li>您的姓別不能為空!</li>"
Founderr = True
Else
usersex = Newasp.CheckBadstr(Request.Form("usersex"))
End If
If usersex = "女" Then
sex = 0
Else
sex = 1
End If
If Founderr = True Then Exit Sub
Set Rs = Server.CreateObject("ADODB.RecordSet")
SQL = "SELECT * FROM [NC_user] WHERE username='" & username & "' And userid=" & CLng(userid)
Rs.Open SQL, Conn, 1, 3
If Rs.bof And Rs.EOF Then
ErrMsg = ErrMsg + "<li>Sorry!沒有找到此用戶信息信息!</li>"
Founderr = True
Exit Sub
Else
If password <> Rs("password") Then
ErrMsg = ErrMsg + "<li>您輸入的密碼錯誤!</li>"
Founderr = True
Exit Sub
End If
If Founderr = False Then
'-----------------------------------------------------------------
'系統(tǒng)整合
'-----------------------------------------------------------------
Dim API_Newasp,API_SaveCookie,SysKey
If API_Enable Then
Set API_Newasp = New API_Conformity
API_Newasp.NodeValue "action","update",0,False
API_Newasp.NodeValue "username",UserName,1,False
Md5OLD = 1
SysKey = Md5(API_Newasp.XmlNode("username") & API_ConformKey)
Md5OLD = 0
API_Newasp.NodeValue "syskey",SysKey,0,False
API_Newasp.NodeValue "password","",1,False
API_Newasp.NodeValue "answer",Request.Form("answer"),1,False
API_Newasp.NodeValue "question",Request.Form("question"),1,False
API_Newasp.NodeValue "email",Request.Form("usermail"),1,False
API_Newasp.NodeValue "gender",sex,0,False
API_Newasp.SendHttpData
If API_Newasp.Status = "1" Then
Founderr = True
ErrMsg = API_Newasp.Message
Exit Sub
End If
Set API_Newasp = Nothing
End If
'-----------------------------------------------------------------
End If
Rs("nickname") = Newasp.CheckBadstr(Request.Form("nickname"))
Rs("TrueName") = Newasp.CheckBadstr(Request.Form("TrueName"))
Rs("usermail") = Trim(Request.Form("usermail"))
If Trim(Request.Form("HomePage")) <> "" Then Rs("HomePage") = Trim(Request.Form("HomePage"))
If Trim(Request.Form("usersex")) <> "" Then Rs("usersex") = usersex
If Trim(Request.Form("question")) <> "" Then Rs("question") = Trim(Request.Form("question"))
If Trim(Request.Form("answer")) <> "" Then Rs("answer") = md5(Trim(Request.Form("answer")))
If Trim(Request.Form("phone")) <> "" Then Rs("phone") = Trim(Request.Form("phone"))
If Trim(Request.Form("oicq")) <> "" Then Rs("oicq") = Trim(Request.Form("oicq"))
If Trim(Request.Form("postcode")) <> "" Then Rs("postcode") = Trim(Request.Form("postcode"))
If Trim(Request.Form("UserIDCard")) <> "" Then Rs("UserIDCard") = Trim(Request.Form("UserIDCard"))
If Trim(Request.Form("address")) <> "" Then Rs("address") = Trim(Request.Form("address"))
If Trim(Request.Form("BuyCode")) <> "" Then Rs("BuyCode") = md5(Trim(Request.Form("BuyCode")))
Rs.Update
End If
Rs.Close
Set Rs = Nothing
Call Returnsuc("<li>恭喜您!用戶資料修改成功。</li>")
End Sub
%>
<!--#include file="foot.inc"-->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -