📄 profile.asp
字号:
<!--#INCLUDE FILE="config.asp" -->
<%
Function ChkString(string)
if Len(string)>250 then string= Left(string,240) & "*超长*"
if string = "" then string = " "
ChkString = server.htmlencode(Replace(string, "'", "''"))
End Function
if Request.Form("Password")<>"" then Response.Cookies("User")("Pword")= Request.Form("Password")
set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString
%>
<!--#INCLUDE FILE="top.asp" -->
<table width=<%=TableWidth%> border =0 align="center" class="sft"><tr><td><a href="index.asp">论坛首页</a> > <%
if Request.QueryString("mode") <> "" then
Response.Write "用户档案"
else
Response.Write "新用户注册"
end if%>
</td></tr></table>
<%
select case Request.QueryString("mode")
case "edit"%>
<form action="profile.asp?mode=go&id=<%=Request.QueryString("id")%>" method="post">
<table align="center" bgcolor=<%=TableColor%> border="0" width=320 cellspacing="1" cellpadding="3" class="sft">
<TR>
<TD width="30%" align="right" bgcolor=<%=CellColor1%>>用户名 :</td>
<TD width="70%" bgcolor=<%=CellColor1%>><INPUT name="Name" size="20" value="<%=Request.Cookies("User")("Name")%>" class="box"></td></TR>
<TR>
<TD bgcolor=<%=CellColor1%> align="right">密码 :</td>
<TD bgcolor=<%=CellColor1%>><INPUT name="password" type=password size="20" value="<%=Request.Cookies("User")("Pword")%>" class="box"></td></TR>
<TR>
<TD bgcolor=<%=CellColor1%> align=center colspan=2><input type=submit value="确 定" class="btn"></td>
</TR></table></form>
<%
case "go"
StrSql = "Select * from members where m_name='" & ChkString(Request.Form("name"))
StrSql = StrSql & "' and m_Password ='" & ChkString(Request.Form("Password")) & "'"
set rs = my_conn.Execute(StrSql)
if rs.bof and rs.eof then
%>
<center>无效的用户名或密码!<br><br>
<a href="javascript:history.go(-1)">退回论坛</a>
<%
Response.End
else
%>
<form action="profile.asp?mode=doit&id=<%=Request.QueryString("id")%>" method="post" id=form1 name=form1>
<!-- #include file="profile2.asp" -->
</form>
<%
end if
case "doit"
face_w=0
face_h=0
if IsNumeric(Request.Form("OtherFace_Width")) and IsNumeric(Request.Form("OtherFace_Height")) then
face_w = cint(Request.Form("OtherFace_Width"))
face_h = cint(Request.Form("OtherFace_Height"))
if face_w >120 then face_w=120
if face_h >120 then face_h=120
end if
facestr = Request.Form("Face")
if Len(facestr)>16 then facestr = "face/1.gif"
strpass = Request.Form("password")
if Len(strpass)>16 then str = Left(strpass, 16)
StrSQl = "Update Members Set M_Email = '" & chkstring(Request.Form("email")) & "', "
StrSQl = StrSQl & "M_Password ='" & ChkString(strpass) & "', "
StrSQl = StrSQl & "M_Country ='" & ChkString(Request.Form("country")) & "', "
StrSQl = StrSQl & "M_Question ='" & ChkString(Request.Form("question")) & "', "
StrSQl = StrSQl & "M_Return ='" & ChkString(Request.Form("restr")) & "', "
StrSQl = StrSQl & "M_Sig ='" & ChkString(Request.Form("sig")) & "', "
StrSQl = StrSQl & "M_OtherFace_Width =" & face_w & ", "
StrSQl = StrSQl & "M_OtherFace_Height =" & face_h & ", "
StrSQl = StrSQl & "M_ICQ ='" & ChkString(Request.Form("ICQ")) & "', "
StrSQl = StrSQl & "M_MSN ='" & ChkString(Request.Form("MSN")) & "', "
StrSQl = StrSQl & "M_Face ='" & ChkString(facestr) & "', "
strSQl = StrSQl & "M_Sex =" & cint(Request.Form("Sex")) & ", "
strSQl = StrSQl & "M_OtherFace ='" & ChkString(Request.Form("otherface")) & "', "
StrSQl = StrSQl & "M_Homepage ='" & ChkString(Request.Form("homepage")) & "' where M_Name = '"
StrSQl = StrSQl & ChkString(Request.Form("name")) & "'"
my_conn.Execute(strSql)
%>
<br><br><br><table align="center" bgcolor=<%=TableColor%> border="0" width=360 cellspacing="1" cellpadding="3" class="sft">
<tr><td bgcolor=<%=CellColor1%> align="center">
已经更新了你的个人档案!<br><br>正在<a href="index.asp">返回论坛首页</a>...
<script language=javascript>
setTimeout("location.replace('index.asp')",500)
</script>
</td></tr></table>
<%
end select
on error resume next
rs.close
my_conn.Close
set my_conn = nothing
set rs=nothing
set face_h=nothing
set face_w=nothing
set facestr=nothing
set size=nothing
set icq=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -