重定向问题,急死人

cucu_love_lilie 2004-11-25 10:34:34
这代码一直无法完成重定向的问题……各为帮我看看到底什么地方出了错误了……晕啊……
<!--#include file="conn.asp"-->
<%
if request.QueryString("video_id")="" then
response.write error
response.end
end if
Set rs = Server.CreateObject("ADODB.RecordSet")
sql = "select * from video where video_id='"&video_id&"'"
rs.open sql, conn, 3, 3
if not rs.eof then
rs("dianji").value = rs("dianji").value + 1
rs.update()
down_url=rs("down_url")
end if
rs.close()
Set rs = nothing
conn.close()
Set conn = nothing
Response.Redirect down_url
...全文
175 16 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
cucu_love_lilie 2004-11-27
  • 打赏
  • 举报
回复
CSDN竟然没有人愿意解决这个问题…………失望……
luits 2004-11-27
  • 打赏
  • 举报
回复
第一:不能单独调用该文件。单独调用会出现两个问题:1、程序第五行会终止程序;2、sql语句会出现错误(所以你的程序排错能力要改进

第二:
<!--#include file="conn.asp"-->
<%
if request.QueryString("video_id")="" then
response.write("error")
response.end
end if
Set rs = Server.CreateObject("ADODB.RecordSet")
sql = "select * from video where video_id="&request.QueryString("video_id")
'response.write(sql)
'response.end
rs.open sql, conn, 3, 3
if not rs.eof then
rs("dianji").value = rs("dianji").value + 1
rs.update()
down_url=rs("down_url")
end if
rs.close()
Set rs = nothing
conn.close()
Set conn = nothing
response.Write down_url
Response.Redirect down_url
%>

第三:blue_video.asp的第108行参数传递有错,id要改为video_id

第四:这样改完后可以重定向了,但要的不是这个结果吧。你可以不要做这么麻烦啊。
cheng17 2004-11-26
  • 打赏
  • 举报
回复
<%
down_url=request(rs("down_url"))
%>
这里错了吧,如果是要重定向数据库里的字段,用response.redirect rs("down_url")
如果是上一页传过来的值,用 response.redirect request("down_url")
zhangjun 2004-11-26
  • 打赏
  • 举报
回复
上面要把Response.Redirect down_url注释掉
zhangjun 2004-11-26
  • 打赏
  • 举报
回复
if request.QueryString("video_id")="" then
response.write error
response.end
end if
Set rs = Server.CreateObject("ADODB.RecordSet")
sql = "select * from video where video_id='"&video_id&"'"
rs.open sql, conn, 3, 3
if not rs.eof then
rs("dianji").value = rs("dianji").value + 1
rs.update()
down_url=rs("down_url")
end if
rs.close()
Set rs = nothing
conn.close()
Set conn = nothing
Response.Redirect down_url

Response.Write "<script language=""javascript"">parent.location.href="""& down_url &""";</script>"
我是杨威利 2004-11-26
  • 打赏
  • 举报
回复
把down_url=request(rs("down_url"))或者down_url=request("down_url")放在rs和conn close之前试验一下。
cucu_love_lilie 2004-11-26
  • 打赏
  • 举报
回复
up up
cucu_love_lilie 2004-11-26
  • 打赏
  • 举报
回复
各位,你们的我都试了,可还是不能解决,难道是添加的时候出了问题……我把代码地址给你们吧
哪位好心的人看了帮我改改,在下先说声谢谢了!!!
http://www.deep-blue.cn/mysite.rar
cucu_love_lilie 2004-11-25
  • 打赏
  • 举报
回复
没人帮吗??up up
cucu_love_lilie 2004-11-25
  • 打赏
  • 举报
回复
error我定义过,就是去掉问题还是依旧
jozosoft 2004-11-25
  • 打赏
  • 举报
回复
好像是
response.write error
中的error没有初始值呢
cucu_love_lilie 2004-11-25
  • 打赏
  • 举报
回复
<!--#include file="conn.asp"-->
<%
if request("video_id")="" then
response.write "非法操作,请确认不要输入错误的数字"
response.end
end if
%>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from video where video_id="&request("video_id")&""
rs.Open sql,conn,1,3
%>
<%
down_url=request(rs("down_url"))
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>^^^</title>
<link href="../style/blue_2005.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
color: #18859A;
font-weight: bold;
}
-->
</style>
</head>

<body>
<table width="980" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="45" valign="top"><table width="45" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../main/images/right_bottom.jpg" width="45" height="312"></td>
</tr>
<tr>
<td background="../main/images/right_bg.jpg"> </td>
</tr>
<tr>
<td><img src="../main/images/right_top.jpg" width="45" height="164"></td>
</tr>
</table></td>
<td valign="top"><table width="209" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><a href="../main.asp"><img src="../website_info/images/logo.jpg" width="166" height="69" border="0"></a></div></td>
</tr>
<tr>
<td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="209" height="445">
<param name="movie" value="../website_info/images/about_us_menu.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<param name="menu" value="false">
<embed src="../website_info/images/about_us_menu.swf" width="209" height="445" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" menu="false"></embed>
</object></td>
</tr>
</table></td>
<td width="726" valign="top"><table width="726" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="158" background="../main/images/top_bg.jpg"> </td>
</tr>
<tr>
<td><div align="right">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="199" height="22">
<param name="movie" value="../website_info/images/top_menu_about_us.swf">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="menu" value="false">
<embed src="../website_info/images/top_menu_about_us.swf" width="199" height="22" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"></embed>
</object>
</div></td>
</tr>
<tr>
<td><img src="images/top_title.gif" width="618" height="74"></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width="726" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="188" valign="top"><img src="<%=(rs("img"))%>" border="0"></td>
<td width="538" valign="top"><table width="538" border="0" cellpadding="0" cellspacing="0" background="images/video_id_bg.gif">
<tr>
<td width="21"> </td>
<td width="65" height="37">文件大小</td>
<td width="166"><%=rs("video_size")%></td>
<td width="64">播放软件</td>
<td width="222"><%=rs("player")%></td>
</tr>
<tr>
<td> </td>
<td height="30">更新日期</td>
<td><%=rs("time")%></td>
<td>播放时间</td>
<td valign="middle"><%=rs("play_time")%></td>
</tr>
<tr>
<td> </td>
<td height="31">文件类型</td>
<td><%=rs("video_lx")%></td>
<td>下载人气</td>
<td><%=rs("dianji")%></td>
</tr>
</table>
<table width="538" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10"> </td>
<td width="528"><a href="down_url.asp?id=<%=rs("video_id")%>&url=<%=rs("down_url")%>"><img src="images/icon_download.gif" width="80" height="30" border="0"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" valign="top"><table width="726" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14"> </td>
<td width="662"><span class="style1">此Video的介绍</span></td>
<td width="50"> </td>
</tr>
<tr>
<td> </td>
<td><%=rs("neirong")%></td>
<td> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<table width="726" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="100"> </td>
</tr>
<tr>
<td><div align="right"><img src="../website_info/images/copy.gif" width="650" height="78" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" coords="279,39,362,51" href="http://www.deep-blue.cn">
</map>
</div></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
cucu_love_lilie 2004-11-25
  • 打赏
  • 举报
回复
我的意思是定向到某个地址而已
sdts 2004-11-25
  • 打赏
  • 举报
回复
重定向到文件??? 行吗?
cucu_love_lilie 2004-11-25
  • 打赏
  • 举报
回复
即使出现go.asp?id=1&url=http://www.111.com/11.rar时,也无法定向到11.rar这个文件
  • 打赏
  • 举报
回复
down_url检查一下这个值

28,408

社区成员

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

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