偶参考过论坛的一些贴,还是不能解答自己的问题..
1.偶要达到的效果是利用iframe显示文章内容,
2.偶试过<iframe sre="**.asp?id="></iframe>.不行.结果还是返回偶的测试错误.
3.文件:onews.asp 部分关键代码
<!--#include file="conn/conn.asp" -->
<%owen=request("id")%>
<html>
<head>
<title>::##</title>
<link rel="stylesheet" href="mycss.css" type="text/css">
</head>
<body>
<%
Set rsnews=Server.CreateObject("ADODB.RecordSet")
sql="update news set hits=hits+1 where id="&cstr(request("id"))
conn.execute sql
sql="select * from news where id="&owen
rsnews.Open sql,conn,1,1
title=rsnews("title")
if rsnews.eof and rsnews.bof then
response.Write("数据库出错")
else
%>
<table>
<tr><td>
<IFRAME STYLE="border: 0" src="onew3.asp?id="WIDTH=752 HEIGHT=400 marginheight="0" marginwidth="0" frameborder="0" scrolling="yes" ></IFRAME>
</td>
</tr><TABEL>
<%
end if
rsnews.close
set rsnews=nothing
%>
4.文件:onews3.asp,作用是显示内容
<html>
<head>
<link href="mycss.css" rel="stylesheet" type="text/css">
<!--#include file="conn/conn.asp" -->
</head>
<body>
<%
Set rsnews=Server.CreateObject("ADODB.RecordSet")
sql="update news set hits=hits+1 where id="&cstr(request("id"))
conn.execute sql
sql="select * from news where id="&owen
rsnews.Open sql,conn,1,1
title=rsnews("title")
if rsnews.eof and rsnews.bof then
response.Write("数据库出错")
else
%>
<table width="750" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td align="center" class="style20" width="750" height="15"> </td>
<tr>
<td class="STYLE1" >
<%= rsnews("content") %>
</td>
<tr>
<td class="STYLE1" style="border-bottom: 1 dotted #666666" width="750" height="10"> </td>
<tr>
<td class="STYLE1"width="750" height="15" > </td>
<tr>
<td class="STYLE1" ><%
Set Rs = conn.execute("Select id,title from news where id = "& id-1)
if Rs.eof and Rs.bof then
Response.write "上一篇:已经没有了。"
else
Response.write "上一篇:<a href=onews.asp?id="& rs(0) &">"& rs(1) &"</a>"
end if
%>
<%
rs.close
Set Rs = conn.execute("Select id,title from news where id = "& id+1)
if Rs.eof and Rs.bof then
Response.write "下一篇:已经没有了。"
else
Response.write "下一篇:<a href=onews.asp?id="& rs(0) &">"& rs(1) &"</a>"
end if
rs.close
%></td>
<tr>
</table>
<%
end if
rsnews.close
set rsnews=nothing
%>
</body>
</html>
5.结果是"数据库错误."
[此贴子已经被作者于2006-7-25 14:25:50编辑过]