一個BBS的原始碼(六)

來源:互聯網
上載者:User
原始碼 <%
'==================================================================================================
Case "Adduser"
'==================================================================================================
' 添加使用者
'==============

Userid = Trim(Request("Userid"))
Password = Trim(Request("Password"))
Confirm = Trim(Request("Confirm"))
Email = Trim(Request("Email"))

WrongMsg = ""

If Userid = "" Then WrongMsg = WrongMsg + "<DD><LI>帳號為空白。</LI>"
If Password = "" Then WrongMsg = WrongMsg + "<DD><LI>密碼為空白。</LI>"
If Confirm = "" Then WrongMsg = WrongMsg + "<DD><LI>重複密碼為空白。</LI>"
If Email = "" Then WrongMsg = WrongMsg + "<DD><LI>郵件地址為空白。</LI>"

If WrongMsg = "" Then

If Password <> Confirm Then WrongMsg = WrongMsg + "<DD><LI>兩次輸入密碼不相同。</LI>"
If Not CheckEmail( Email ) Then WrongMsg = WrongMsg + "<DD><LI>非法郵件地址。</LI>"

If WrongMsg = "" Then
SQL = "SELECT * FROM bbsmember WHERE [帳號]='" & SqlStr(Userid) & "'"
RecMember.Open SQL , Con , 1
If RecMember.BOF AND RecMember.EOF Then UserExist = False Else UserExist = True
RecMember.Close

If Not UserExist Then
SQL = "INSERT INTO bbsmember ([帳號],[密碼],[郵件]) VALUES('" &_
SqlStr( Userid ) & "','" &_
SqlStr( Password ) & "','" &_
SqlStr( Email ) & "')"
Con.Execute( SQL )
Else
WrongMsg = WrongMsg + "<DD><LI>使用者名稱已經存在。</LI>"
End If

End If

End If

%>
<TABLE align=center border=0 cellPadding=7 cellSpacing=0 width=650>
<TR>
<TD class=menu>
<%
If WrongMsg = "" Then ' 顯示成功資訊
%>
恭喜你!你已經成功註冊!<BR><BR>
<A href="/">返回“飛林莊”</A><BR>
<A href="<%= ASP_FILE_NAME %>?Job=List">返回“經驗交流”</A><BR>
<A href="<%= ASP_FILE_NAME %>?Job=Write">發表文章</A><BR>
<%
Else ' 顯示錯誤資訊
%>
操作失敗:<BR>
<%= WrongMsg %><BR><BR>
<A href="javascript:history.back()">返回上一頁</A>
<%
End If
%>
</TD>
</TR>
</TABLE>

<%



'==================================================================================================
Case "Send"
'==================================================================================================
' 發送郵件
' (把文章發送到使用者信箱)
'=============================

Which = Request("Which")
Email = Trim( Request("Email") )

%>
<TABLE align=center border=0 cellPadding=7 cellSpacing=0 width=650>
<TR>
<TD



相關文章

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。