最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ASP技术在论坛中的运用。(六) (建论坛的完整程序,吐血推荐!!!!)
时间:2008-01-18 编辑:简简单单 来源:一聚教程网
< html>
< head>
< title>发表文章< /title>
< meta http-equiv="Content-Type" content="text/html; charset=gb2312">
< /head>
< body bgcolor="#FFFFFF">
< %
author=request("author")
password=request("password")
topicid=request("topicid")
boardid=request("boardid")
content=request("content")
title=request("title")
这一段取出在submit.asp中提交的表但内容,放在相应的变量中。
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("bbssystem.mdb")
Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = conn
'查询作者是否已存在
cmd.CommandText = "select * from 作者表 where id='" & author &"'"
Set rs = cmd.Execute()
'检查权限
if rs.eof or rs.bof then
response.write "< h3>你还没有注册,请先< a href=register.htm>注册< /a>後在来发表文章< /h3>"
response.write "< /body>< /html>"
response.end
end if
if password< > rs("密码") then
response.write "< h2>密码错误,请检查密码是否正确< /h2>"
response.write "< /body>< /html>"
response.end
end if
这一段是对作者权限进检查,对于账号不存在或者密码错误做出相应的错误处理。在这儿可以看到response.end的用法,它是用来结束当前ASP脚本。结合if语句,可以对程序中的预期错误进行处理。在一个好的WEB应用中,错误处理是必不可少的。
-
上一个: 线程的处理(1)
-
下一个: bbs的数据结构和存储过程(二)
相关文章
- asp仿采集程序 09-05
- asp 输出word文档程序 02-22
- asp sogou收录抓取程序 12-03
- asp 程序提示中午好,上午好程序 06-23
- [招聘]asp程序员 2000-5000 04-06
- [招聘] asp程序员 03-27