<% Sub ShowForm() %>
border =0 align="center" class="sft">
论坛首页 > 用户注册
<% End Sub %> <% If Request.QueryString("mode") <> "doit" then if Request.QueryString("agree") <> "yes" then %> border="0" width=380 cellspacing="1" cellpadding="3" class="sft"> >
align="center" class="sfh">新用户注册

欢迎您注册为本论坛的用户,作为论坛用户必须要遵守以下协议:

1 不得违反国家的法律法规;

2 不得恶意中伤或发表不文明的言论;

3 版主和管理员有权修改或删除违反本协议的帖子.

<% 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 Function ChkUserString(string) string = ChkString(string) ChkUserString = server.htmlencode(Replace(string, " ", "")) End Function Err_Msg = "" if Request.Form("name") = "" then Err_Msg = Err_Msg & "*请填写用户名
" if len(Request.Form("name")) > 10 then Err_Msg = Err_Msg & "*用户名过长
" if Request.Form("password") = "" then Err_Msg = Err_Msg & "*请填写密码
" if Request.Form("password") <> Request.Form("password2") then Err_Msg = Err_Msg & "*你输入的两次密码不同
" if len(Request.Form("password")) > 16 then Err_Msg = Err_Msg & "*密码过长
" if Request.Form("email") = "" then Err_Msg = Err_Msg & "*请填写E-Mail地址
" if len(Request.Form("email")) > 30 then Err_Msg = Err_Msg & "*E-Mail过长
" if Request.Form("icq")<>"" and not(IsNumeric(Request.Form("icq"))) then Err_Msg = Err_Msg & "*QQ号码只能为数字
" set my_conn= Server.CreateObject("ADODB.Connection") my_Conn.Open ConnString strSql = "Select M_Name from members where M_Name = '" & ChkUserString(Request.Form("name")) &"'" set rs = my_conn.Execute (StrSql) if not (rs.bof or rs.eof) then Err_Msg = Err_Msg & "*很抱歉,您选择的用户名"& ChkUserString(Request.Form("name"))&"已被其他用户使用,请更换一个
" 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_Num, M_Homepage, M_Reg_Day) Values ('" strSql = StrSQl & ChkUserString(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 & ChkString(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, 0, '" strSql = StrSQl & ChkString(Request.Form("homepage")) & "', #" strSql = StrSQl & Now() & "#)" my_conn.Execute (StrSql) strSQl ="Update totals set U_Count=totals.U_Count + 1, P_NewUser ='" & ChkUserString(Request.Form("name")) & "'" my_conn.Execute (strSQL) else %> border="0" width=360 cellspacing="1" cellpadding="3" class="sft">
align="center" class="sfh">您填写的资料中出现错误
> <%= Err_Msg %>
<% call ShowForm On Error Resume next my_conn.Close set my_conn = nothing Response.End End If %> border="0" width=360 cellspacing="1" cellpadding="3" class="sft">
align="center">
感谢您的注册!正在进入登录

<% End If On Error Resume next my_conn.Close set my_conn = nothing %>