开发学院WEB开发ASP 一个BBS的源代码(六) 阅读

一个BBS的源代码(六)

 2000-04-22 10:07:26 来源:WEB开发网   
核心提示:<% '= Case "Adduser" '= ' 添加用户 '== Userid = Trim(Request("Userid")) PassWord = Trim(Request(&quo
<%
'=====================================
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>

Tags:一个 BBS 源代码

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接