懂ASP的来帮我看看这是怎么回事

来源:百度知道 编辑:UC知道 时间:2024/07/04 23:57:12
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp" -->
<%dim new_sql,nw
cid=cint(request("cid"))
if cid=1 then
response.Redirect("index.asp")
elseif cid=6 then
response.Redirect("login.asp")
else
new_sql="select * from class where cid="&cid
set rs=conn.execute(new_sql)
nw=trim(rs("class"))
end if%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" c />
<title>在线新闻||<%response

你的cid是空的,SQL语句查询返回空行,你再Rs("nw")就会报错.
还有,你的链接里没有cid这个字段,你加上吧

你再检查一下CID的值,是不是输入的时候无意中输入了像单引号这样的符号了?
还有,你这个CID是怎么传过来的?是用POST,还是用GET?
用Request.Form(cid)或用Request.QueryString(cid)来取一下值试试看。