·您的位置: 首页 » 资源教程 » 编程开发 » ASP » 一个BBS的源代码(六)

一个BBS的源代码(六)

类别: ASP教程  评论数:0 总得分:0
<%
\'=====================================
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>
-= 资 源 教 程 =-
文 章 搜 索
关键词:
类型:
范围:
纯粹空间 softpure.com
Copyright © 2006-2008 暖阳制作 版权所有
QQ: 15242663 (拒绝闲聊)  Email: faisun@sina.com
 纯粹空间 - 韩国酷站|酷站欣赏|教程大全|资源下载|免费博客|美女壁纸|设计素材|技术论坛   Valid XHTML 1.0 Transitional
百度搜索 谷歌搜索 Alexa搜索 | 粤ICP备19116064号-1