关于弹出窗口,带ID过去,但是ID无法识别

yinxun 2017-07-25 04:46:23
有个页面呈现好多数据,一行一行的,每行有个按钮,查看图纸

比如ID为162的这行记录了好多信息

162,男人,35岁,查看男人照片(按钮)

代码为:<a href="#" onClick="MM_openBrWindow('tuzhi.asp?id=<%=rs("id")%>','','width=800,height=800')">查看</a>

点击以后会弹出一个800*800的窗口,里面呈现162.jpg,这个162是变量,就是ID

弹出的窗口,url为:http://192.168.1.10/tuzhi.asp?id=162,说明162这个ID已经带过去了

然后tuzhi.asp的代码如下,请各位大神帮忙看看




<!--#include file="conn.asp"-->
<style type="text/css">
<!--
td {
font-size: 12px;
}
-->
</style>
<%if request("action")=1 then
dim id
id=request.querystring("id")
sql="select * from nanren where id="&id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3

if rs.eof and rs.bof then
rs.close
set rs=nothing
errinfo="<li>该条记录不存在。</li>"
call showError()
end if
end if
%>

<body bgcolor="#CCCCCC">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><fieldset>
<legend><strong><font color="#0033FF">查看图纸,编号为<%=rs("id")%></font></strong></legend>
<img src="tuzhi/<%=rs("id")%>.jpg" width="750" height="750">
</fieldset></td>
</tr>
</table>
...全文
206 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Go 旅城通票 2017-07-25
  • 打赏
  • 举报
回复
<%if request("action")=1 then 你不是加了action判断,你又没有传递action的值,俺不是rs不是游标,获取值就报错了,去掉action判断
<%'''''''''''''''''''''''''''''''''''''''''''if request("action")=1 then
dim id
id=request.querystring("id")
sql="select * from nanren where id="&id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3

if rs.eof and rs.bof then
rs.close
set rs=nothing
errinfo="<li>该条记录不存在。</li>"
call showError()
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''end if
%>
yinxun 2017-07-25
  • 打赏
  • 举报
回复
然后就是显示不出来,请问怎么回事

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧