一个BBS的源代码(六)
程序员文章站
2022-06-23 16:25:22
<%=====================================case "adduser"===================================== 添加用户=...
<%
=====================================
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>
=====================================
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>