欢迎光临
我们一直在努力

一个BBS的源代码(五)

建站超值云服务器,限时71元/月

=================================

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>

<p>

必须的资料:<br>

<font color=#ff0000>账号</font>:

<input id=userid name=userid size=40 maxlength=80><br>

这是你的个人标识,可以使用中文或者英文。<br>

<font color=#ff0000>密码</font>:

<input id=password name=password type=password maxlength=80 size=25><br>

为保障你的账号的正当权益,请谨慎选择你的密码!<br>

<font color=#ff0000>重复密码</font>:

<input id=confirm name=confirm type=password maxlength=80 size=25><br>

确认你的密码。<br>

<font color=#ff0000>电子邮件</font>:

<input id=email name=email size=60 maxlength=80><br>

这是我们的唯一必须的个人资料。

</p>

<%

<p>

个人资料:<br>

真实性名:<input id=username maxlength=80 name=username><br>

性别:

<input id=sex name=sex type=radio value=男>男

<input id=sex name=sex type=radio value=女>女<br>

年龄: <input id=age name=age size=3 maxlength=4>

</p>

<p>

联系方式:<br>

省份:<select id=province name=province size=1>

<option value="北京" selected> 北京 </option>

<option value="北京"> 广东 </option>

<option value="广西"> 广西 </option>

<option value="海南"> 海南 </option>

<option value="福建"> 福建 </option>

<option value="天津"> 天津 </option>

<option value="湖南"> 湖南 </option>

<option value="湖北"> 湖北 </option>

<option value="河南"> 河南 </option>

<option value="河北"> 河北 </option>

<option value="山东"> 山东 </option>

<option value="山西"> 山西 </option>

<option value="黑龙江"> 黑龙江 </option>

<option value="辽宁"> 辽宁 </option>

<option value="上海"> 上海 </option>

<option value="甘肃"> 甘肃 </option>

<option value="青海"> 青海 </option>

<option value="新疆"> 新疆 </option>

<option value="西藏"> 西藏 </option>

<option value="宁夏"> 宁夏 </option>

<option value="四川"> 四川 </option>

<option value="云南"> 云南 </option>

<option value="吉林"> 吉林 </option>

<option value="内蒙古"> 内蒙古 </option>

<option value="陕西"> 陕西 </option>

<option value="安徽"> 安徽 </option>

<option value="贵州"> 贵州 </option>

<option value="江苏"> 江苏 </option>

<option value="重庆"> 重庆 </option>

<option value="浙江"> 浙江 </option>

<option value="江西"> 江西 </option>

</select><br>

icq:<input id=icq maxlength=80 name=icq size=30><br>

公司/个人 主页:<input id=homepage name=homepage maxlength=80 size=60>

</p>

%>

<p>

<input id=submit4 name=submit4 type=submit value=" 我 填 好 了 !"><br>

<input id=reset2 name=reset2 type=reset value=" 我 要 重 新 填 ! "><br>

</p>

</form>

</td>

</tr>

</table>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 一个BBS的源代码(五)
分享到: 更多 (0)

相关推荐

  • 暂无文章