?? 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 + -