我写一个关于二级菜单的,数据库的名称:hm.mdb 表的名称是:SmallClass 表里面的字段有: ID , SmallClassID, SmallClassType, BigClassName, SmallClassName, SmallClassMaster
现在程序代码如下,请大家帮我检查一下,怎么不能显示二级菜单(SmallClassName的值):
1.admin_Newsadd1.asp
<%pagename="admin_newsadd"%>
<!--#include file="session.asp"-->
<%checkadmin1%>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="top.asp"-->
<table border="1" width="755" cellspacing="0" cellpadding="1" bgcolor="<%=mainbgcolor%>">
<tr>
<td valign=top width=20%><!--#include file="admin_left.asp"--></td>
<td valign=top>
<form method="post" action="admin_newsadd2.asp">
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="tableline" bordercolorlight="<%=mainbcolor%>" bgcolor="<%=mainccolor%>">
<tr>
<td width="100%" height="20" colspan=2 align=center bgcolor="<%=maintcolor%>"><b>增 加 新 闻</b></td>
</tr>
<tr>
<td align="center">
<p> </p>
<p> </p>
<p>
<%
sql="select * from bigclass order by bigclassid"
rs.open sql,conn,1,1
%>
<select name="bigclassname" size="1" onChange="window.open('admin_newsadd1.asp?bigclassname='+this.options[this.selectedindex].value,'_self')">
<option value="" <%if request("bigclassname")="" then%> selected<%end if%>>选择大类</option>
<%
''111111111111111111111111111111111111111111111111111111111111111111111111111111
if session("key")="super" or session("key")="senior" then '如果是高级以上管理员
while not rs.eof
%>
<option<%if request("bigclassname")=rs("bigclassname") and request("bigclassname")<>"" then%> selected<%end if%> value="<%=rs("bigclassname")%>" name=bigclassname><%=rs("bigclassname")%></option>
<%
rs.movenext
wend
else
while not rs.eof
if instr(rs("bigclassmaster"),session("username"))<>0 then '如果是大类管理员
%>
<option<%if request("bigclassname")=rs("bigclassname") and request("bigclassname")<>"" then%> selected<%end if%> value="<%=rs("bigclassname")%>" name=bigclassname><%=rs("bigclassname")%></option>
<%
end if
set rs1=server.createobject ("adodb.recordset") '如果小类有这个大类管理员
sql1="select * from smallclass where bigclassname='"& rs("bigclassname") & "' and instr(smallclassmaster,'"&session("username")&"')<>0"
rs1.open sql1,conn,1,1
if not rs1.eof then
%>
<option<%if request("bigclassname")=rs("bigclassname") and request("bigclassname")<>"" then%> selected<%end if%> value="<%=rs("bigclassname")%>" name=bigclassname><%=rs("bigclassname")%></option>
<%
end if
rs1.close
set rs1=nothing
rs.movenext
wend
end if
%>
</select>
<%
if request("bigclassname")<>"" then%>
<select name="smallclassid" size="1">
<option value="" <%if request("smallclassid")="" then%> selected<%end if%>>选择小类</option>
<%
set trs=server.createobject("adodb.recordset")
if session("key")="inter" then
set rs1=server.createobject("adodb.recordset")
sql1="select bigclassmaster from bigclass where bigclassname='"&request("bigclassname")&"'"
rs1.open sql1,conn,1,1
if instr(rs1("bigclassmaster"),session("username"))<>0 then
sql="select * from smallclass where bigclassname='"&request("bigclassname")&"' order by smallclassid"
else
sql="select * from smallclass where instr(smallclassmaster,'"&session("username")&"')<>0 and bigclassname='"&request("bigclassname")&"' order by smallclassid"
end if
rs1.close
set rs1=nothing
end if
if session("key")="super" or session("key")="senior" then sql="select * from smallclass where bigclassname='"&request("bigclassname")&"' order by smallclassid"
if session("key")="input" or session("key")="check" then sql="select * from smallclass where bigclassname='"&request("bigclassname")&"' and instr(smallclassmaster,'"&session("username")&"')<>0 order by smallclassid"
trs.open sql,conn,1,1
do while not trs.eof
%>
<option<%if cstr(request("smallclassid"))=cstr(trs("smallclassid")) and request("smallclassid")<>"" then%> selected<%end if%> value="<%=cstr(trs("smallclassid"))%>" name=smallclassid><%=trs("smallclassname")%></option>
<%
trs.movenext
loop
trs.close
%>
<%else%>
<select name="smallclassid" size="1">
<option value="" selected>选择小类</option>
<%end if%>
</select>
</p>
<p> </p>
<p> </p>
</td>
</tr>
<tr>
<td align="center" height="25">
<input type="submit" value=" 确 定 " name="cmdok">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<%rs.close
set trs=nothing
set rs=nothing%>
<!--#include file="copyright.asp"-->
2.admin_Newsadd2.asp
<%pagename="admin_newsadd2"%>
<!--#include file="session.asp"-->
<%checkadmin1%>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="top.asp"-->
<%
bigclassname=request.form("bigclassname")
if bigclassname="" then
%>
<script language=javascript>
history.back()
alert("请选择新闻大类!如果没有请添加!")
</script>
<%
response.end
end if
smallclassid=request.form("smallclassid")
if smallclassid="" then
%>
<script language=javascript>
history.back()
alert("请选择新闻小类!如果没有请添加!")
</script>
<%
response.end
end if
%>
<script language="javascript">
<!--
function checkform()
{
if (document.form1.txttitle.value.length == 0) {
alert("请输入文章标题.");
document.form1.txttitle.focus();
return false;
}
if (document.form1.about.value.length == 0) {
alert("请输入关键词.");
document.form1.about.focus();
return false;
}
document.form1.content.value=document.form1.doc_html.value;
return true
}
//-->
</script>
<table border="1" width="755" cellspacing="0" cellpadding="1" bgcolor="<%=mainbgcolor%>">
<tr>
<td valign=top>
<form method="post" action="admin_newsadd3.asp" name="form1" onSubmit="return checkform()">
<table border="0" cellspacing="0" width="100%" bordercolorlight="#000000" bordercolordark="#ffffff" cellpadding="0" bgcolor="#000000">
<tr align="center">
<td width="100%">
<table border="0" cellspacing="1" width="100%" cellpadding="3">
<tr align="center">
<td height="20" colspan=2 align=center bgcolor="<%=maintcolor%>"><b>添
加 新 闻</b> </td>
</tr>
<tr>
<td width="14%" align="right" class="unnamed2" valign="middle" bgcolor="#ffffff">所属大类:</td>
<input type=hidden name="bigclassname" value='<%=bigclassname%>'>
<td bgcolor="#ffffff"> <%=bigclassname%></td>
</tr>
<tr>
<td width="14%" align="right" class="unnamed2" valign="middle" bgcolor="#ffffff"> 所属小类:</td>
<td bgcolor="#ffffff">
<%
sql="select smallclassname from smallclass where smallclassid="&smallclassid
rs.open sql,conn,1,1
if not rs.eof then
smallclassname=rs("smallclassname")
end if
rs.close
%>
<%=smallclassname%>
<input type=hidden name="smallclassname" value='<%=smallclassname%>'>
</td>
</tr>
<!--新加入阅读权限beg-->
<tr>
<td width="14%" align="right" class="unnamed2" valign="middle" bgcolor="#ffffff"><font color="#ff0000">*</font> 阅读权限:</td>
<td bgcolor="#ffffff">
<select name="userlevel" size="1">
<option value="0" selected>无要求</option>
<%
set rs1=server.createobject("adodb.recordset")
sql1="select * from usergrade order by id"
rs1.open sql1,conn,1,1
while not rs1.eof
%>
<option value="<%=rs1("id")%>"><%=rs1("userlevel")%></option>
<% rs1.movenext
wend
rs1.close
set rs1=nothing
%>
</select>
</td>
</tr>
<!--新加入阅读权限end-->
<tr>
<td width="14%" align="right" class="unnamed2" valign="middle" bgcolor="#ffffff">所属专题:</td>
<td bgcolor="#ffffff">
<select name="specialname" size="1">
<%
sql="select * from special order by specialid"
rs.open sql,conn,1,1
%>
<option value="无">不属于任何专题</option>
<%if rs.eof then %>
<option value="无" selected>暂无任何专题</option>
<%else
while not rs.eof
%>
<option value="<%=rs("specialname")%>"><%=rs("specialname")%></option>
<%
rs.movenext
wend
end if
rs.close
%>
</select>
</td>
</tr>
<tr>
<td width="14%" align="right" class="unnamed2" valign="middle" bgcolor="#ffffff"><font color="#ff0000">*</font> 新闻标题:</td>
<td bgcolor="#ffffff"> <span style='cursor:hand' title='缩短对话框' onclick='if (me.size>10)me.size=me.size-2'>-</span>
<input name="txttitle" id=me type="text" size=60 maxlength=100 style="background-color:ffffff;color:000000;border: 1 double">
<span style='cursor:hand' title='加长对话框' onclick='if (me.size<102)me.size=me.size+2'>+</span>
</td>
</tr>
<tr>
<td width="14%" align="right" class="unnamed2" valign="middle" bgcolor="#ffffff">新闻来源:</td>
<td bgcolor="#ffffff"> <span style='cursor:hand' title='缩短对话框' onclick='if (message.size>10)message.size=message.size-2'>-</span>
<input name="original" id=message type="text" size=30 maxlength=100 style="background-color:ffffff;color:000000;border: 1 double" value="<%=webname%>">
<span style='cursor:hand' title='加长对话框' onclick='if (message.size<102)message.size=message.size+2'>+</span>
</td>
</tr>
<tr>
<td width="14%" align="right" class="unnamed2" valign="middle" bgcolor="#ffffff">新闻作者:</td>
<td bgcolor="#ffffff"><span style='cursor:hand' title='缩短对话框' onclick='if (mess.size>10)mess.size=mess.size-2'>-</span>
<input name="author" id=mess type="text" size=30 maxlength=100 style="background-color:ffffff;color:000000;border: 1 double">
<span style='cursor:hand' title='加长对话框' onclick='if (mess.size<102)mess.size=mess.size+2'>+</span>
</td>
</tr>
<tr>
<td width="14%" align="right" bgcolor="#ffffff">新闻模版:</td>
<td bgcolor="#ffffff">
<select name="model">
<option value="0">默认模版</option>
<option value="1">新闻模版一</option>
<option value="2">新闻模版二</option>
</select>
</td>
</tr>
<tr>
<td width="14%" align="right" valign="top" class="unnamed2" bgcolor="#ffffff"><font color="#ff0000">*</font> 新闻内容:</td>
<td bgcolor="menu"><object id=doc_html style="left: 0px; top: 0px" data=editor.html width=544 height=320 type=text/x-scriptlet viewastext>
</object>
<input type="hidden" name="content" value="" >
</td>
</tr>
<tr>
<td width="14%" align="right" class="unnamed2" valign="middle" bgcolor="#ffffff"><font color="#ff0000">*</font> 相关新闻:</td>
<td bgcolor="#ffffff"><span style='cursor:hand' title='缩短对话框' onclick='if (ss.size>10)ss.size=ss.size-2'>-</span>
<input name="about" id=ss type="text" size=30 maxlength=100 style="background-color:ffffff;color:000000;border: 1 double">
<span style='cursor:hand' title='加长对话框' onclick='if (ss.size<102)ss.size=ss.size+2'>+</span>
填入关键字或完整标题 </td>
</tr>
<tr>
<td width="14%" align="right" valign="middle" class="unnamed2" bgcolor="#ffffff">新闻性质:</td>
<td valign="middle" bgcolor="#ffffff"> 焦点新闻:
<input type="checkbox" name="focusnews">
推荐新闻:
<input type="checkbox" name="goodnews">
热点新闻:
<input type="checkbox" name="hot">
<%if session("key")<>"input" then%>
新闻固顶:
<input type="checkbox" name="ontop">
<%end if%>
</td>
</tr>
<%if opencheck=true then
if session("key")<>"input" then%>
<tr>
<td width="14%" align="right" bgcolor="#ffffff">通过审核:</td>
<td bgcolor="#ffffff">
<input type="checkbox" name="checked">
</td>
</tr>
<%end if
else%>
<tr>
<td width="14%" align="right" bgcolor="#ffffff">通过审核:</td>
<td bgcolor="#ffffff">
<input type="checkbox" name="checked" checked>
</td>
</tr>
<%end if%>
<tr>
<td width="14%" align="right" bgcolor="#ffffff">图片张数:</td>
<td bgcolor="#ffffff" valign="middle">
<input name="image" type="text" size=2 maxlength=2 style="background-color:ffffff;color:000000;border: 1 double" value=0>
指直接使用编辑器插入代码的图片总数(即序号"n"值)</td>
</tr>
<tr>
<td width="14%" align="right" bgcolor="#ffffff">发布时间:</td>
<td bgcolor="#ffffff">
<input name="updatetime" type="text" size=20 maxlength=20 style="background-color:ffffff;color:000000;border: 1 double" value="<%=now()%>">
当前时间为:<%=now()%> 注意不要改变格式。</td>
</tr>
<tr>
<td height="25" colspan=2 align="center" bgcolor="#ffffff">
<font color="#ff0000">注意:当下栏可视化编辑器出现图标显示不全的问题,请重新进入,否则保存后内容会消失。</font></td>
</tr>
<tr>
<td height="20" colspan=2 align=center bgcolor="#ffffff">
<input type="submit" value=" 添 加 "
name="cmdok" class="unnamed5">
<input type="reset" value=" 清 除 "
name="cmdcancel" class="unnamed5">
<input type="button" name="ok" value=" 放 弃 " onClick="javascript:history.go(-1)">
<input type="button" value="计算字数" onClick="alert('本篇文章共'+document.form1.doc_html.value.length+'字节')" name="submit1">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<%set rs=nothing%>
<!--#include file="copyright.asp"-->
当admin_Newsadd1.asp执行完后转到admin_Newsadd2.asp中时,会提示"请选择新闻小类!如果没有请添加!",请各位大侠帮我看看这是怎么回事啊???
我的QQ: 279490384 邮箱:ze119@163.com