一小段代码解释

来源:百度知道 编辑:UC知道 时间:2024/05/16 18:47:22
%>
<!--#include file="Ft_config.asp"-->
<!--#include file="Ft_conn.asp"-->
<!--#include file="Ft_format.asp"-->
<!--#include file="Ft_lib.asp"-->
<%
sub_title="经典教程"
call head()
call body()
call foot()
sub body()
dim totalart,currentpage,totalpages,i,cat_id,class_id,page,flname
'设置文章系统为默认分页大小的倍率
pagenum=pagenum*2
if request.querystring("cat_id")<>"" then
cat_id=checksql("文章分类",request.querystring("cat_id"),0,4)
sql="select cat_id from Ft_art_cat where cat_id="&cat_id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.redirect("showerr.asp?errmsg=<br><li>没有此分类或该分类已删除!</li>")
response.end
end if
rs.close
set rs=nothing
end if

VBScript脚本代码解释
<!--以下include皆为引入文件内容-->
<!--#include file="Ft_config.asp"-->
<!--#include file="Ft_conn.asp"-->
<!--#include file="Ft_format.asp"-->
<!--#include file="Ft_lib.asp"-->
<%
sub_title="经典教程" '设置一个标题变量
call head() '执行 名为 head()的函数
call body()
call foot()
sub body() '皆与上同
'定义变量
dim totalart,currentpage,totalpages,i,cat_id,class_id,page,flname
'设置文章系统为默认分页大小的倍率,为pagenum的数值*2
pagenum=pagenum*2
'当页面请求中"cat_id"这一参数不为空时,条件成立
if request.querystring("cat_id")<>"" then
'checksql为自制函数,返回一个cat_id
cat_id=checksql("文章分类",request.querystring("cat_id"),0,4)
'sql语句,数据库表Ft_art_cat中cat_id
sql="select cat_id from Ft_art_cat where cat_id="&cat_id
'创建recordset对象rs
set rs=server.createobject("