找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 113|回复: 2

[求助]iframe不能正确传ID问题!(有代码)

[复制链接]
发表于 2010-1-20 03:55:58 | 显示全部楼层 |阅读模式 IP:江苏扬州
偶参考过论坛的一些贴,还是不能解答自己的问题..
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
[知识问答ωωω.χiuGoo.сom]
%>

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">&nbsp;</td>
<tr>
<td class="STYLE1" >
<%= rsnews("content") %>
</td>
<tr>
<td class="STYLE1" style="border-bottom: 1 dotted #666666" width="750" height="10">&nbsp;</td>
<tr>
<td class="STYLE1"width="750" height="15" >&nbsp;</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
%>
&nbsp;
<%
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.结果是"数据库错误."
发表于 2010-1-20 03:56:02 | 显示全部楼层 IP:江苏扬州
得刷新一下网页才能传值吧?
你数据库有没有数据?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 05:26 , Processed in 0.401680 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表