⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 register.asp

📁 本程序开发的是一个论坛系统
💻 ASP
字号:
<%
Sub DoCount
    ' ###  Updates the totals Table
    strSQl ="Update totals set totals.U_Count=totals.U_Count + 1"
    my_conn.Execute (strSQL)
End Sub


Sub ShowForm()
%>
<center>
<form action="register.asp?mode=doit" method="post">
<font face="<% =DefaultFontFace %>">
<p><font size=4>Register For <% =BBTitle %></font></p>

<!--#INCLUDE FILE="profile.inc" -->

<% End Sub %>

<!--#INCLUDE FILE="config.inc" -->
<!--#INCLUDE FILE="top.inc" -->

<%
If Request.QueryString("mode") <> "doit" then
	Call ShowForm
Else

	Function ChkString(string)
		if string = "" then string = " "
		ChkString = Replace(string, "'", "''")
	End Function

	Err_Msg = ""
	if Request.Form("name") = "" then Err_Msg = Err_Msg & "<li>You must choose a Username</li>"
	if Request.Form("password") = "" then Err_Msg = Err_Msg &  "<li>You must choose a password</li>"
	if Request.Form("password") <>  Request.Form("password2") then Err_Msg = Err_Msg & "<li>Your Passwords didn't match.</li>"
	if Request.Form("email") = "" then Err_Msg = Err_Msg & "<li>You Must give an email address</li>"

	

		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 rs.bof and rs.eof then 
			' OK
		Else 
			Err_Msg = Err_Msg & "<li>Username already in Use, Please Choose Another</li>"
		End If
		rs.close
		set rs = nothing
	
		if Err_Msg = "" then
	
		 strSql = "insert into members  (M_Name, M_Password, M_Email, M_Country, M_Sig, M_ICQ, 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("sig")) & "', '"
		 strSql = strSQL & ChkString(Request.Form("ICQ")) & "', "
		 strSql = strSQL & "0, '"
		 strSql = StrSQl & ChkString(Request.Form("homepage")) & "')"

		 my_conn.Execute (StrSql)
		 docount
		Else
	
%>
<center>
<font face="<% =DefaultFontFace %>" size=4>
<p>There Was A Problem With Your Details -</p>

<ul>
<%= Err_Msg %>
</ul>
</center>
<%

		call ShowForm
		On Error Resume next
	    my_conn.Close
		set my_conn = nothing
		Response.End
		End If


%>
<font face="<% =DefaultFontFace %>" size=4>
<center>
<p>Your Registration Has Been Completed!</p>
<font size=3><a href="javascript:history.go(-2)">Back To Forum</a></font>
</center>
</font>
<%
End If
On Error Resume next
my_conn.Close
set my_conn = nothing

%>
    
    
    </BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -