设为首页收藏本站

新微赢技术网

 找回密码
 注册
搜索
热搜: 回贴
查看: 48|回复: 1
打印 上一主题 下一主题

联动下来菜单 页面输出 问题 请高手帮忙

[复制链接]
跳转到指定楼层
1#
发表于 2010-1-11 02:16:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
表名   nyxx   
字段  id  , pid  , qid ,  title   ,   content
联动页面  menu.asp 代码如下:
<!--#include file="conn.asp"-->
<script language="JavaScript">
sall=new Array();
<%
dim i
i=0
set rs=server.CreateObject("adodb.recordset")
    sql="select * from nyxx where pid<>0 and id in(Select max(id) from nyxx group by qid) and id in(Select max(id) from nyxx group by qid)"
    rs.open sql,conn,1,1
    if not rs.eof then
    do until rs.eof
%>
sall[<%=i%>]=new Array("<%=rs("pid")%>","<%=rs("id")%>","<%=rs("qid")%>");
<%
i=i+1
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
function changeselect(selvalue)  
   {
      document.all.xl.length=0;  
      var selvalue=selvalue;
      var i;
      for(i=0;i<sall.length;i++)
    {
        if(sall[i][0]==selvalue)
              {
  var newOption1=new Option(sall[i][2],sall[i][1]);
            document.all.xl.add(newOption1);
        }
    }
}
</script>
<form method="POST" action="right_id.asp?pid=1"  onsubmit="return checkncp1(this)" name="form1"  target="menu">

<select name="dl" ID="dl" onChange="changeselect(document.all.dl.options[document.all.dl.selectedIndex].value)">
      <option>请选择</option>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from nyxx where pid=0"
rs.open sql,conn,1,1
do while not rs.eof
%>
      <option value="<%=rs("id")%>"><%=rs("title")%></option>
<%rs.MoveNext:Loop%>
</select>
    &nbsp;&nbsp; <select name="xl" ID="xl" onChange="javascript:select24_onchange()">
        <option value="<%rs=("pid")%>">请选择</option>
      </select>
<input type="submit" value="确定" name="B1" style="height:20" >
</form>



想在  right_id.asp页面输出    qid相同的内容  并且pid等于1的

right_id.asp 页面内容如下
<!-- #include file="conn.asp" --><%
qid=trim(Request("qid"))
set rs=server.CreateObject("adodb.recordset")
sql = "select * from nyxx where id=id and pid=pid"
rs.Open sql,conn,1,1
%>
<%
dim MaxPerPage
MaxPerPage=20
dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next
If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
call list
Sub list()%>
<!-- #include file="Inc/Head.asp" -->
<table width="100%"  border="0" cellspacing="0" cellpadding="0" >
  <tr>
    <td><table width="100%" height="165" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="100%" valign="top"><table width="100%" height="100%" border="0"cellpadding="0" cellspacing="0" >
  <td align="center" valign="top">
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="">
        <%
if not rs.eof then
i=0
do while not rs.eof
%>
        <tr>
          <td width="20%" height="28" style="font-size: 12px;"></td>
          <td width="80%" style="line-height:150%;font-size: 14px;"><a href="right_id_c.asp?id=<%=rs("id")%>"><%=rs("title")%></a> </td>
        </tr>
        <%
i=i+1
if i >= MaxPerpage then exit do
rs.movenext
loop
end if
%>
        <tr valign="bottom">
          <td height="20"></td>
          <td height="20">
          <p>&nbsp;</p>
          <p>&nbsp;</p>
          <p>&nbsp;</p>
          <p>&nbsp;</p>
         
              
                <div align="center">
                    <%
Response.write "全部-"
Response.write "共" & Cstr(Rs.RecordCount) & "篇&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
Response.write "第" & Cstr(CurrentPage) &  "/" & Cstr(rs.pagecount) & "&nbsp;"
If currentpage > 1 Then
response.write "<a href='right_id.asp?&page="+cstr(1)+"&qid="&qid&"'>&nbsp;首页&nbsp;</a>"
Response.write "<a href='right_id.asp?page="+Cstr(currentPage-1)+"&qid="&qid&"'>&nbsp;上一页&nbsp;</a>"
Else
Response.write "&nbsp;上一页&nbsp;"
End if
If currentpage < Rs.PageCount Then
Response.write "<a href='right_id.asp?page="+Cstr(currentPage+1)+"&qid="&qid&"'>&nbsp;下一页&nbsp;</a>"
Else
Response.write ""
Response.write "&nbsp;下一页&nbsp;"
End if
Response.write "转到第"
response.write"<select name='sel_page' onChange='javascript:location=this.options[this.selectedIndex].value;'>"
    for i = 1 to Rs.PageCount
       if i = currentpage then
          response.write"<option value='right_id.asp?page="&i&"&qid="&qid&"' selected>"&i&"</option>"
       else
          response.write"<option value='right_id.asp?page="&i&"&qid="&qid&"'>"&i&"</option>"
       end if
    next
response.write"</select>页"
%>
                </div></td>
          <td height="20">&nbsp;</td>
        </tr>
      </table>
          <%
End sub
rs.close
%></td>
  </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>

请哪位高手帮忙解决一下
万份感谢!!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

申请友链|小黑屋|最新主题|手机版|新微赢技术网 ( 苏ICP备08020429号 )  

GMT+8, 2024-11-20 09:21 , Processed in 0.095814 second(s), 9 queries , Gzip On, Memcache On.

Powered by xuexi

© 2001-2013 HaiAn.Com.Cn Inc. 寰耽

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