链接出现问题了!

xingpin 2008-04-12 03:58:34

<%
dim Tpagesize,Tsum
'nexti
Tpagesize=""
Tsum="0"
' nexti=1
dim id,showtitle,alttitle,picurl,linkurl,pkid,viewstatus
id=0
showtitle=""
alttitle=""
picurl=""
linkurl=""
pkid=""
viewstatus=""
Tpagesize=request.form("page")
if Tpagesize="" or Tpagesize=0 then Tpagesize=request.querystring("page")
if Tpagesize="" or Tpagesize=0 then Tpagesize=1
set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection = connstr
cmd.CommandText = "dbo.Nes_ALTER_picture" '@mydate
cmd.CommandType = adCmdSPStoredProc
cmd.Parameters.Append cmd.CreateParameter("@Page", adInteger,adParaminput,4,Tpagesize)
cmd.Parameters.Append cmd.CreateParameter("@RecsPerPage", adInteger,adParaminput,4,20)
cmd.parameters.Append cmd.CreateParameter("@count",adInteger,adParamoutput)
cmd.execute()
Tsum=cmd.parameters("@count").value
%>


<tr bgcolor="#FAEC89">
<td width="8%" align="center">编号</td>
<td align="center" width="40%" >文章标题</td>
<td width="12%" align="center">图片预览</td>
<td align="center"width="8%">可见性</td>
<td align="center"width="8%">链接</td>
<td width="8%" align="center">编辑</td>
</tr>

<%
set rs=cmd.execute()
while not rs.eof
id=id+1
showtitle=rs("title")
picurl=rs("pic")
linkurl=rs("content") viewstatus=rs("stauts")
pkid=rs("tjid")

%>

<tr>
<td align="center"><%=id%></td>
<td align="center"><%=showtitle%></td>
<td><div style="text-align:center;"><img src="<%=picurl%>" alt="" width="60" height="67" border="1" longdesc="images/famousteacher.gif"></td>
<td><div style="text-align:center;"><% If viewstatus=0 Then response.write("<a href='setindex.asp?action=upst&status=1&acid="& pkid &"&page="& Tpagesize &"' onClick=""return confirm('确定要修改为“隐藏”状态吗?');"" title='点击修改为“隐藏”状态'><font color='green'>显示</font></a>") Else If viewstatus=1 Then response.write("<a href='setindex.asp?action=upst&status=0&acid="& pkid &"&page="& Tpagesize &"' onClick=""return confirm('确定要修改为“显示”状态吗?');"" title='点击修改为“显示”状态'><font color='red'>隐藏</font></a>") End If %></div></td>
<td align="center"><a href="<%=linkurl%>" target="_blank">文章链接</a></td> <td align="center"><div style="text-align:center;"><a href="setindex2.asp?pkid=<%=pkid%>" >[编辑]</a><br /><a href="setindex.asp?action=upst&status=2&acid=<%=pkid%>&page=<%=Tpagesize%>" onClick="return confirm('确定要删除吗?');">[删除]</a></div></td>
</tr>
<%
' nexti=nexti+1
rs.movenext()
wend
rs.close()
set rs=nothing
set cmd=nothing
%>
<tr align="center" bgcolor="#0099FF"> <FORM name="jumpform" METHOD=POST ACTION="">
<td colspan=8>
<SCRIPT LANGUAGE="JavaScript">
function jumpurl()
{
var url="setindex.asp?";
url=url+"page="+jumpform.page.value;
window.location=url;
return false
}
</SCRIPT>
<%=response.write(Nes.plotpage(Tpagesize,20,Tsum,"setindex.asp?1=1" ))%>
</td></form>
</table>
<!-- InstanceEndEditable --> </TD>
<TD background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_right_border.gif></TD></TR>
<TR>
<TD><IMG height=50 src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_bottom_lcorner.gif"
width=30></TD>
<TD align=right
background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_bottom_border.gif> </TD>
<TD><IMG height=50 src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_bottom_rcorner.gif"
width=30></TD></TR></TBODY></TABLE></TD>
<TD vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 width="98%" align=center border=0>
<TBODY></TBODY></TABLE></TD>
<TD width=14
background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_right_border.gif></TD></TR>
<TR>
<TD width=14 height=18><IMG height=18
src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_bottom_lcorner.gif" width=14 border=0></TD>
<TD background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_bottom_border.gif
colSpan=2> </TD>
<TD width=14 height=18><IMG height=18
src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_bottom_rcorner.gif" width=14
border=0></TD></TR></TBODY></TABLE></BODY><!-- InstanceEnd --></HTML>


链接的时候出现错误了,全部链接的是同一个页面,还是主页面!请问是怎么回事啊!
链接数据库是没有问题的!


...全文
54 点赞 收藏 10
写回复
10 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
xingpin 2008-04-12
呵呵!问题解决了,不过还是要谢谢各位的帮忙!
回复
xingpin 2008-04-12
接:
<%
set rs=cmd.execute()
while not rs.eof
id=id+1
showtitle=rs("title")
picurl=rs("pic")
linkurl=rs("content") viewstatus=rs("stauts")
pkid=rs("tjid")
%>

<tr>
<td align="center"><%=id%></td>
<td align="center"><%=showtitle%></td>
<td><div style="text-align:center;"><img src="<%=picurl%>" alt="" width="60" height="67" border="1" longdesc="images/famousteacher.gif"></td>
<td><div style="text-align:center;"><% If viewstatus=0 Then response.write("<a href='setindex.asp?action=upst&status=1&acid="& pkid &"&page="& Tpagesize &"' onClick=""return confirm('确定要修改为“隐藏”状态吗?');"" title='点击修改为“隐藏”状态'><font color='green'>显示</font></a>") Else If viewstatus=1 Then response.write("<a href='setindex.asp?action=upst&status=0&acid="& pkid &"&page="& Tpagesize &"' onClick=""return confirm('确定要修改为“显示”状态吗?');"" title='点击修改为“显示”状态'><font color='red'>隐藏</font></a>") End If %></div></td>
<td align="center"><a href="<%=linkurl%>" target="_blank">文章链接</a></td> <td align="center"><div style="text-align:center;"><a href="setindex2.asp?pkid=<%=pkid%>" >[编辑]</a><br /><a href="setindex.asp?action=upst&status=2&acid=<%=pkid%>&page=<%=Tpagesize%>" onClick="return confirm('确定要删除吗?');">[删除]</a></div></td>
</tr>
<%
' nexti=nexti+1
rs.movenext()
wend
rs.close()
set rs=nothing
set cmd=nothing
%>
<tr align="center" bgcolor="#0099FF"> <FORM name="jumpform" METHOD=POST ACTION="">
<td colspan=8>
<SCRIPT LANGUAGE="JavaScript">
function jumpurl()
{
var url="setindex.asp?";
url=url+"page="+jumpform.page.value;
window.location=url;
return false
}
</SCRIPT>
<%=response.write(Nes.plotpage(Tpagesize,20,Tsum,"setindex.asp?1=1" ))%>
</td></form>
</table>
<!-- InstanceEndEditable --> </TD>
<TD background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_right_border.gif></TD></TR>
<TR>
<TD><IMG height=50 src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_bottom_lcorner.gif"
width=30></TD>
<TD align=right
background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_bottom_border.gif> </TD>
<TD><IMG height=50 src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_bottom_rcorner.gif"
width=30></TD></TR></TBODY></TABLE></TD>
<TD vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 width="98%" align=center border=0>
<TBODY></TBODY></TABLE></TD>
<TD width=14
background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_right_border.gif></TD></TR>
<TR>
<TD width=14 height=18><IMG height=18
src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_bottom_lcorner.gif" width=14 border=0></TD>
<TD background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_bottom_border.gif
colSpan=2> </TD>
<TD width=14 height=18><IMG height=18
src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_bottom_rcorner.gif" width=14
border=0></TD></TR></TBODY></TABLE></BODY><!-- InstanceEnd --></HTML>



回复
xingpin 2008-04-12
<!--#include file="inc/initialize.asp"-->
<%
'response.write("新年心语活动已经结束!")
'response.end
call Nes.UserCheck(session("se_userid"),session("se_passwd"),"9999")

dim action,vstatus
action=""
vstatus=""
action=request.querystring("action")
dim acpage
dim acid

if action="upst" then
action=""
acid=""
acpage="1"
If IsNull(request.querystring("page")) Then
acpage="1"
Else
acpage=request.querystring("page")
If acpage="" Or acpage=0 Then
acpage="1"
End If
End If

acid=request.querystring("acid")
vstatus=""
vstatus=request.querystring("status")

set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection = connstr
cmd.CommandText = "dbo.Nes_ALTER_picture"
cmd.CommandType = adCmdSPStoredProc
cmd.Para
ateParameter("@Page", adinteger,adParaminput,4,1)
cmd.Parameters.Append cmd.CreateParameter("@RecsPerPage", adinteger,adParaminput,4,1)
cmd.Parameters.Append cmd.CreateParameter("@count", adinteger,adParamoutput)
cmd.Parameters.Append cmd.CreateParameter("@pkid", adinteger,adParaminput,4,acid)
cmd.Parameters.Append cmd.CreateParameter("@stauts", adinteger,adParaminput,4,vstatus)
cmd.execute()
set cmd=nothing
response.write("<script>alert('操作成功!');window.location='setindex.asp?page="&acpage&"';</script>")
response.End
end If
%>
<HTML><!-- InstanceBegin template="/Templates/write.dwt" codeOutsideHTMLIsLocked="false" --><HEAD>
<META http-equiv=content-type content="text/html; charset=gb2312"><LINK
href="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/style.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<script type="text/javascript" src="../fckeditor/fckeditor.js"></script>
<script type="text/javascript" language="javascript" src="inc/calendar1.js" charset="gb2312" ></script>
</HEAD>
<BODY language=javascript
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"
bgColor=#ffa800 ms_positioning="gridlayout">
<!-- <form id="form1" action="" method="post" name="form1"> -->
<TABLE id=Table1 height="100%" cellSpacing=0 cellPadding=0 width="100%"
bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD width=14 height=14><IMG height=14
src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_top_corner.gif" width=14 border=0></TD>
<TD background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_top_border.gif colSpan=2
height=14></TD>
<TD width=14 height=14><IMG height=14
src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_top_rcorner.gif" width=14 border=0></TD></TR>
<TR>
<TD width=14 background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_top_lborder.gif></TD>
<TD vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR>
<!-- <form name="form2" action="" method="post"> -->
<TD width="31"><IMG height=36 src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_top_lcorner.gif"
width=30></TD>
<TD style="PADDING-TOP: 8px" width=100%
background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_top_border.gif>『
<!-- InstanceBeginEditable name="title" -->
“滚动图片”管理 』    【<a href="setindex.assp">添加“滚动图片”</a>】        <FONT color='red'>请保持可见性为『 显示 』数据为六条,否则部分信息可能无法展示</FONT>
<!-- InstanceEndEditable --></TD>
<TD width="41"><IMG height=36 src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_top_rcorner.gif"
width=30></TD> <!-- </form> -->
</TR>
<TR>
<TD background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_left_border.gif></TD>
<TD style="LINE-HEIGHT: 25px" vAlign=top height=100%>
<!-- InstanceBeginEditable name="main" -->
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolordark="#ffffFF" bordercolorlight="#CCCCCC">
<%
dim Tpagesize,Tsum
'nexti
Tpagesize=""
Tsum="0"
' nexti=1
dim id,showtitle,alttitle,picurl,linkurl,pkid,viewstatus
id=0
showtitle=""
alttitle=""
picurl=""
linkurl=""
pkid=""
viewstatus=""
Tpagesize=request.form("page")
if Tpagesize="" or Tpagesize=0 then Tpagesize=request.querystring("page")
if Tpagesize="" or Tpagesize=0 then Tpagesize=1
set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection = connstr
cmd.CommandText = "dbo.Nes_ALTER_picture" '@mydate
cmd.CommandType = adCmdSPStoredProc
cmd.Parameters.Append cmd.CreateParameter("@Page", adInteger,adParaminput,4,Tpagesize)
cmd.Parameters.Append cmd.CreateParameter("@RecsPerPage", adInteger,adParaminput,4,20)
cmd.parameters.Append cmd.CreateParameter("@count",adInteger,adParamoutput)
cmd.execute()
Tsum=cmd.parameters("@count").value
%>


<tr bgcolor="#FAEC89">
<td width="8%" align="center">编号</td>
<td align="center" width="40%" >文章标题</td>
<td width="12%" align="center">图片预览</td>
<td align="center"width="8%">可见性</td>
<td align="center"width="8%">链接</td>
<td width="8%" align="center">编辑</td>
</tr>
回复
hookee 2008-04-12
可以把生成的HTML源代码查一下,是不是和数据库里的值一致。
把有问题的html代码贴一下看看
回复
不是告诉你了吗?
就是因为你那个是空值
回复
xingpin 2008-04-12
帮一下忙啊!
回复
xingpin 2008-04-12
那请问为什么一个能链接一个不能链接的呢!
回复
以为你你这个的linkurl有值啊

linkurl=rs("content")
viewstatus=rs("stauts")
看看你的这个,肯定没值
回复
xingpin 2008-04-12
在另一个页面一样的代码是可以用的,为什么我的就不行了呢!
<%
dim Tpagesize,Tsum
'nexti
Tpagesize=""
Tsum="0"
' nexti=1
dim id,showtitle,alttitle,picurl,linkurl,pkid,viewstatus
id=0
showtitle=""
alttitle=""
picurl=""
linkurl=""
pkid=""
viewstatus=""
Tpagesize=request.form("page")
if Tpagesize="" or Tpagesize=0 then Tpagesize=request.querystring("page")
if Tpagesize="" or Tpagesize=0 then Tpagesize=1
set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection = connstr
cmd.CommandText = "dbo.Nes_ALTER_picture" '@mydate
cmd.CommandType = adCmdSPStoredProc
cmd.Parameters.Append cmd.CreateParameter("@Page", adInteger,adParaminput,6,Tpagesize)
cmd.Parameters.Append cmd.CreateParameter("@RecsPerPage", adInteger,adParaminput,6,20)
cmd.parameters.Append cmd.CreateParameter("@count",adInteger,adParamoutput)
cmd.execute()
Tsum=cmd.parameters("@count").value
%>


<tr bgcolor="#FAEC89">
<td width="8%" align="center">编号</td>
<td align="center" width="40%" >文字标题</td>
<td width="12%" align="center">图片预览</td>
<td align="center"width="8%">可见性</td>
<td align="center"width="8%">链接</td>
<td width="8%" align="center">编辑</td>
</tr>

<%
set rs=cmd.execute()
while not rs.eof
id=id+1
showtitle=rs("title")
picurl=rs("pic")
linkurl=rs("content") viewstatus=rs("stauts")
pkid=rs("tjid")
%>

<tr>
<td align="center"><%=id%></td>
<td align="center"><%=showtitle%></td>
<td><div style="text-align:center;"><img src="<%=picurl%>" alt="" width="60" height="67" border="1" longdesc="images/famousteacher.gif"></td>
<td><div style="text-align:center;"><% If viewstatus=0 Then response.write("<a href='IndexMag.asp?action=upst&status=1&acid="& pkid &"&page="& Tpagesize &"' onClick=""return confirm('确定要修改为“隐藏”状态吗?');"" title='点击修改为“隐藏”状态'><font color='green'>显示</font></a>") Else If viewstatus=1 Then response.write("<a href='IndexMag.asp?action=upst&status=0&acid="& pkid &"&page="& Tpagesize &"' onClick=""return confirm('确定要修改为“显示”状态吗?');"" title='点击修改为“显示”状态'><font color='red'>隐藏</font></a>") End If %></div></td>
<td align="center"><a href="<%=linkurl%>" target="_blank">文章链接</a></td> <td align="center"><div style="text-align:center;"><a href="setindex.asp?pkid=<%=pkid%>" >[编辑]</a><br /><a href="IndexMag.asp?action=upst&status=2&acid=<%=pkid%>&page=<%=Tpagesize%>" onClick="return confirm('确定要删除吗?');">[删除]</a></div></td>
</tr>
<%
' nexti=nexti+1
rs.movenext()
wend
rs.close()
set rs=nothing
set cmd=nothing
%>
<tr align="center" bgcolor="#0099FF"> <FORM name="jumpform" METHOD=POST ACTION="">
<td colspan=8>
<SCRIPT LANGUAGE="JavaScript">
function jumpurl()
{
var url="IndexMag.asp?";
url=url+"page="+jumpform.page.value;
window.location=url;
return false
}
</SCRIPT>
<%=response.write(Nes.plotpage(Tpagesize,20,Tsum,"IndexMag.asp?1=1" ))%>
</td></form>
</table>
<!-- InstanceEndEditable --> </TD>
<TD background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_right_border.gif></TD></TR>
<TR>
<TD><IMG height=50 src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_bottom_lcorner.gif"
width=30></TD>
<TD align=right
background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_bottom_border.gif> </TD>
<TD><IMG height=50 src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/info_bottom_rcorner.gif"
width=30></TD></TR></TBODY></TABLE></TD>
<TD vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 width="98%" align=center border=0>
<TBODY></TBODY></TABLE></TD>
<TD width=14
background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_right_border.gif></TD></TR>
<TR>
<TD width=14 height=18><IMG height=18
src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_bottom_lcorner.gif" width=14 border=0></TD>
<TD background=indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_bottom_border.gif
colSpan=2> </TD>
<TD width=14 height=18><IMG height=18
src="indexMain.files/Mainright1.files/contentMain.files/contentMainup.files/content_bottom_rcorner.gif" width=14
border=0></TD></TR></TBODY></TABLE></BODY><!-- InstanceEnd --></HTML>

这个是可以用的!

回复
很正常
你linkurl是空值
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2008-04-12 03:58
社区公告
暂无公告