当前位置: 移动技术网 > IT编程>开发语言>.net > 一个BBS的源代码(五)

一个BBS的源代码(五)

2019年01月16日  | 移动技术网IT编程  | 我要评论

奇乐影院,tintsetp,oxoeedfade

=================================
case "modify"
================================
修改文章

which = request("which")
whichid = getid( which )

if left( which , 1 ) = "e" then table = "bbs" else table = "bbsreply"

wrongmsg = ""

if request("modify") = "yes" then

userid = request("userid")
password = request("password")
title = trim(request("title"))
content = rtrim(request("content"))

if title = "\" then wrongmsg = wrongmsg + "<dd><li>题目不能为空。</li>"
if content = "" then wrongmsg = wrongmsg + "<dd><li>内容不能为空。</li>"

if wrongmsg = "" then
recbbs.open "select [作者] from " & table & " where [序号]=" & whichid , con , 1
if recbbs.fields("作者") = userid then
sql = "select count(*) from bbsmember where [账号]=" & sqlstr(userid) & " and [密码]=" & sqlstr(password) & ""
recmember.open sql , con , 1
if recmember.fields(0) > 0 then
sql = "update " & table & " set [题目]=" & sqlstr(title) & ",[内容]=" & sqlstr(content) & " where [序号]=" & whichid
con.execute( sql )
else
wrongmsg = "<dd><li>密码不正确。</li>"
end if
recmember.close
else
wrongmsg = "<dd><li>用户名不正确。</li>"
end if
recbbs.close
end if

end if

title = "\"
content = ""

sql = "select [题目],[内容] from " & table & " where [序号]=" & whichid
recbbs.open sql , con , 1

if not recbbs.eof then
title = recbbs.fields("题目")
content = recbbs.fields("内容")
end if
recbbs.close
%>
<table align=center border=0 cellpadding=1 cellspacing=0 width=650>
<tr>
<td class="menu">
<a href="/">飞林庄</a>-&gt;<a href="<%= asp_file_name %>">经验交流</a>-&gt;<a href="<%= asp_file_name %>?job=content&which=<%= session("bbs_which") %>"><%= session("bbs_whichtitle") %></a>
<% if wrongmsg <> "" then %>
<br><br>修改失败!<br><br>
<%= wrongmsg %><br>
<% else %>
<br><br>修改成功!<br><br>
<% end if %>
<form action="<%= asp_file_name %>" method=post>
<input type=hidden name=job value=modify>
<input type=hidden name=modify value=yes>
<input type=hidden name=which value="<%= which %>">
账号:<input type=text id=userid name=userid size=30 maxlength=80><br>
密码:<input type=password id=password name=password size=30 maxlength=80><br><br>
题目:<input type=text id=title name=title value="<%= title %>">
<textarea id=content name=content cols=80 rows=16><%= content %></textarea><br>
<input type=submit value="确认修改">
</form>
</td>
</tr>
</table>

<%
===============================
case "apply"
===============================
申请账号
%>

<table align=center border=0 cellpadding=7 cellspacing=0 width=650>
<tr>
<td class=menu>
<form action="<%= asp_file_name %>" method=post>
<input type=hidden name=job value=adduser>
<p>飞林庄-&gt;经验交流-&gt;注册账号</p>

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网