📄 register.asp
字号:
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="top.asp" -->
<%
Sub DoCount
strSQl ="Update totals set totals.U_Count=totals.U_Count + 1"
my_conn.Execute (strSQL)
End Sub
Sub ShowForm()
%>
<form action="register.asp?mode=doit" method="post">
<table width=<%=TableWidth%> border =0 align="center" class="sft"><tr><td><a href="index.asp">论坛首页</a> > 用户注册</td></tr></table>
<!--#INCLUDE FILE="profile2.asp" -->
<% End Sub %>
<%
If Request.QueryString("mode") <> "doit" then
if Request.QueryString("agree") <> "yes" then
%>
<form action="register.asp?agree=yes" method=post>
<table align="center" bgcolor=<%=TableColor%> border="0" width=380 cellspacing="1" cellpadding="3" class="sft">
<tr><td bgcolor=<%=HeadColor%> align="center" class="sfh">新用户注册</td></tr>
<tr bgcolor=<%=CellColor1%>><td><br>欢迎您注册为本论坛的用户,作为论坛用户必须要遵守以下协议:
<br><br>1 不得违反国家的法律法规;
<br><br>2 不得恶意中伤或发表不文明的言论;
<br><br>3 版主和管理员有权修改或删除违反本协议的帖子.
<br><br><center><Input type=submit value="我 同 意"></center></form>
</td></tr></table>
<%
else
Call ShowForm
end if
else
Function ChkString(string)
if Len(string)>250 then string= Left(string,240) & "*超长*"
if string = "" then string = " "
ChkString = server.htmlencode(Replace(string, "'", "''"))
End Function
Err_Msg = ""
if Request.Form("name") = "" then Err_Msg = Err_Msg & "*请填写用户名<br>"
if len(Request.Form("name")) > 10 then Err_Msg = Err_Msg & "*用户名过长<br>"
if Request.Form("password") = "" then Err_Msg = Err_Msg & "*请填写密码<br>"
if Request.Form("password") <> Request.Form("password2") then Err_Msg = Err_Msg & "*你输入的两次密码不同<br>"
if len(Request.Form("password")) > 16 then Err_Msg = Err_Msg & "*密码过长<br>"
if Request.Form("email") = "" then Err_Msg = Err_Msg & "*请填写E-Mail地址<br>"
if len(Request.Form("email")) > 30 then Err_Msg = Err_Msg & "*E-Mail过长<br>"
if Request.Form("icq")<>"" and not(IsNumeric(Request.Form("icq"))) then Err_Msg = Err_Msg & "*QQ号码只能为数字<br>"
if Request.Form("msn")<>"" and not(IsNumeric(Request.Form("msn"))) then Err_Msg = Err_Msg & "*MSN号码只能为数字<br>"
set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString
strSql = "Select M_Name from members where M_Name = '" & Request.Form("name") &"'"
set rs = my_conn.Execute (StrSql)
if not (rs.bof or rs.eof) then
Err_Msg = Err_Msg & "*很抱歉,您选择的用户名已被其他用户使用,请更换一个<br>"
End If
rs.close
set rs = nothing
if Err_Msg = "" then
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 = "insert into members (M_Name, M_Password, M_Email, M_Country, M_Question, M_Return, M_Sex, M_Face, M_OtherFace, M_OtherFace_Width, M_OtherFace_Height, M_Sig, M_ICQ, M_MSN, M_Posts, M_Homepage) Values ('"
strSql = StrSQl & ChkString(Request.Form("name")) & "', '"
strSql = StrSQl & ChkString(Request.Form("password")) & "', '"
strSql = StrSQl & ChkString(Request.Form("email")) & "', '"
strSql = StrSQl & ChkString(Request.Form("country")) & "', '"
strSql = StrSQl & ChkString(Request.Form("question")) & "', '"
strSql = StrSQl & ChkString(Request.Form("restr")) & "', "
strSql = StrSQl & cint(Request.Form("sex")) & ", '"
strSql = StrSQl & facestr & "', '"
strSql = strSQL & ChkString(Request.Form("otherface")) & "', "
strSql = StrSQl & face_w & ", "
strSql = StrSQl & face_h & ", '"
strSql = strSQL & ChkString(Request.Form("sig")) & "', '"
strSql = strSQL & ChkString(Request.Form("ICQ")) & "', '"
strSql = strSQL & ChkString(Request.Form("MSN")) & "', "
strSql = strSQL & "0, '"
strSql = StrSQl & ChkString(Request.Form("homepage")) & "')"
my_conn.Execute (StrSql)
docount
else
%>
<table align="center" bgcolor=<%=TableColor%> border="0" width=360 cellspacing="1" cellpadding="3" class="sft">
<tr><td bgcolor=<%=HeadColor%> align="center" class="sfh">您填写的资料中出现错误</td></tr><tr><td bgcolor=<%=CellColor1%>>
<%= Err_Msg %></td></tr></table>
<%
call ShowForm
On Error Resume next
my_conn.Close
set my_conn = nothing
Response.End
End If
%>
<table align="center" bgcolor=<%=TableColor%> border="0" width=360 cellspacing="1" cellpadding="3" class="sft">
<tr><td bgcolor=<%=CellColor1%> align="center">
<br>感谢您的注册!正在<a href="login.asp">进入登录</a><br><br>
<script language=javascript>setTimeout("location.replace('login.asp')",500)</script></td>
</tr>
</table>
<%
End If
On Error Resume next
my_conn.Close
set my_conn = nothing
%>
<!--#INCLUDE FILE="copyright.asp" -->
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -