📄 changeinfo.asp
字号:
<!--#include file="config.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/chkinput.asp"-->
<!--#include file="head.inc"-->
<%
Call InnerLocation("修改会员资料")
Dim Rs,SQL
If CInt(GroupSetting(1)) = 0 Then
ErrMsg = ErrMsg + "<li>对不起!您没有修改用户资料的权限,如有什么问题请联系管理员。</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!错误的系统参数!</li>"
Founderr = True
Else
%>
<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">
<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(Newasp.membername)%>"><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>请填写你常用的邮箱</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>联系电话:</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>联系地址:</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>站内支付所用的交易密码</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=middle class=Usertablerow1 height=20> </td>
<td class=Usertablerow1 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
username = Replace(Request("username"),"'","''")
userid = CLng(Request("userid"))
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("question")) = "" Then
ErrMsg = ErrMsg + "<li>密码提示问题不能为空!</li>"
Founderr = True
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号码请用数字填写。</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 Founderr = True Then Exit Sub
Set Rs = Server.CreateObject("ADODB.RecordSet")
SQL = "select * from [NC_user] where username='" & username & "' and userid=" & userid
Rs.Open SQL, Conn, 1, 3
If Rs.bof And Rs.EOF Then
ErrMsg = ErrMsg + "<li>Sorry!没有找到此用户信息信息!</li>"
Founderr = True
Exit Sub
Else
Rs("nickname") = Trim(Request.Form("nickname"))
Rs("TrueName") = Trim(Request.Form("TrueName"))
Rs("usermail") = Trim(Request.Form("usermail"))
If Trim(Request.Form("HomePage")) <> "" Then Rs("HomePage") = Trim(Request.Form("HomePage"))
Rs("usersex") = Trim(Request.Form("usersex"))
Rs("question") = Trim(Request.Form("question"))
If Trim(Request.Form("answer")) <> "" Then Rs("answer") = md5(Trim(Request.Form("answer")))
Rs("phone") = Trim(Request.Form("phone"))
Rs("oicq") = Trim(Request.Form("oicq"))
Rs("postcode") = Trim(Request.Form("postcode"))
Rs("UserIDCard") = Trim(Request.Form("UserIDCard"))
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 + -