| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 628 人关注过本帖
标题:联动下来菜单 页面输出 问题 请高手帮忙
只看楼主 加入收藏
majian1010
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2008-7-18
收藏
 问题点数:0 回复次数:0 
联动下来菜单 页面输出 问题 请高手帮忙
表名   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>

请哪位高手帮忙解决一下
万份感谢!!!!!!

[[it] 本帖最后由 majian1010 于 2008-11-28 17:51 编辑 [/it]]
搜索更多相关主题的帖子: 菜单 页面 输出 
2008-11-28 17:50
快速回复:联动下来菜单 页面输出 问题 请高手帮忙
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017085 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved