回复小浪子:
这个是处理页面代码 您帮我看看丫
<!--#include file="../inc/adconn.asp"-->
<!--#include file="../css.asp"-->
<% set rs=server.CreateObject("adodb.recordset") %>
<%
if session("admin_name")="" then
response.end
end if%>
<% dim title,pic,content,dalei,xiaolei,sclass
if request("action")="save" then
title=trim(request.Form("title"))
content=trim(request.Form("hw_content"))
dalei=request.Form("dalei")
xiaolei=request.Form("xiaolei")
pic=request.Form("pic")
sql="select * from pud"
rs.open sql,conn,1,3
rs.addnew
rs("nbigarea")=dalei
rs("nsmallarea")=xiaolei
rs("title")=title
rs("pic")=pic
rs("content")=content
rs.update
response.Write "添加信息成功!!"
response.Write "<a href='pud_manage.asp'>"
Response.Write "返回"
Response.Write("</a>")
%>
<%end if%>
<script charset="utf-8" src="../kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="../kindeditor/lang/zh_CN.js"></script>
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name="hw_content"]', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
items : [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright',
'|', 'emoticons', 'image','multiimage','flash', 'media','link','unlink']
});
});
</script>
<script language="JavaScript">
<%
set rs=server.createobject("adodb.recordset")
sql = "select * from nsmallarea "
rs.open sql,conn,1,1
%>
var onecount;
onecount=0;
subcat = new Array();
<%count = 0
do while not rs.eof %>
subcat[<%=count%>] = new Array("<%= trim(rs("nsmallarea"))%>","<%=cstr(rs("nbigarea"))%>","<%=cstr(rs("id"))%>");<%count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form2.xiaolei.length = 0;
var locationid=locationid;
var i;
document.form2.xiaolei.options[document.form2.xiaolei.length] = new Option('直属大类',0);
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form2.xiaolei.options[document.form2.xiaolei.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
if(document.form2.xiaolei.length == 0)
{
document.form2.xiaolei.options[document.form2.xiaolei.length] = new Option("没有相关小类", "0");
}
}
// end JavaScript -->
</script>
<SCRIPT language=JavaScript>
function checkit()
{
if (document.form2.dalei.value.length==0)
{
alert("请选择信息一类!");
document.form2.dalei.focus();
return false;
}
if (document.form2.xiaolei.value.length==0)
{
alert("请选择信息二类!");
document.form2.xiaolei.focus();
return false;
}
if (document.form2.proname.value.length==0)
{
alert("请填写信息名称!");
document.form2.proname.focus();
return false;
}
return true;
}
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<title>添加信息</title>
<link rel="stylesheet" type="text/css" href="manage/rongyu/style.css">
<form method="POST" name="form2" action="pud_add.asp?action=save">
<INPUT name=upfile onchange=return(OnUpFile()) type=hidden>
<INPUT name=upfile2 onchange=return(OnUpFile2()) type=hidden>
<TABLE cellSpacing=1 cellPadding=0 width="550" align=center bgColor=#999999
border=0>
<TBODY>
<TR>
<TD width="735" bgcolor="f0f0f0" id=maintitleback>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
<TBODY>
<TR>
<TD width="100%" height="30" valign="bottom" bgcolor="#FFCC00" id=maintitle>信息添加 -></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD id=mainbg>
<TABLE cellSpacing=1 cellPadding=4 width="100%" border=0 height="218">
<TBODY>
<TR>
<TD height="30" noWrap
background=../images/pics/tile_sub.gif id=titlemedium>
<div align="center"><font color="#FFFFFF">标题</font></div></TD>
<TD height="30" noWrap
background=../images/pics/tile_sub.gif id=titlemedium> <font color=#333333>
<input type="text" name="title">
</font><span style="color: #FF0000">*</span>
<div align="center"></div></TD>
</TR>
<TR>
<TD bgColor=#ffffff height="30">信息大类</TD>
<TD height="30" bgColor=#ffffff><select name="dalei" id="dalei" onChange="changelocation(document.form2.dalei.options[document.form2.dalei.selectedIndex].value)" >
<option value="">选择一类</option>
<%set rs1=server.CreateObject("adodb.recordset")
sql1="Select * from nbigarea order by num"
rs1.open sql1,conn,1,1
if rs1.eof and rs1.bof then
response.write "没有大类"
else
do while not rs1.eof
%>
<option value="<%=rs1("id")%>"><%=rs1("nbigarea")%></option>
<%
rs1.movenext
loop
end if
rs1.close
set rs1=nothing
%>
</select>
</TD>
</TR>
<TR>
<TD bgColor=#ffffff height="30">信息小类</TD>
<TD height="30" bgColor=#ffffff><select name="xiaolei" id="xiaolei">
<option selected>选择二类</option>
</select></TD>
</TR>
<TR>
<TD bgColor=#ffffff height="30">信息首页显示图片</TD>
<TD height="30" align=left bgColor=#ffffff><input name="pic" type="text" id="pic5">
<span style="color: #FF0000">(这行请勿动,自动生成!!!)</span></TD>
<TR>
<TD bgColor=#ffffff height="30">上传首页显示图片</TD>
<TD height="30" align=left bgColor=#ffffff>
<% call lanyuhtml("upload.asp",400,25)%>
<span style="color: #FF0000">(图片宽度最大为700像素,高度不限!!!)</span> </TD>
<TR>
<TD bgColor=#ffffff height="30">
<div align="center" style="color: #000000">信息内容</div></TD>
<TD height="30" align=center bgColor=#ffffff>
<textarea name="hw_content" style="width:700px;height:400px;visibility:hidden;">请输入内容……</textarea>
<font color=#ff6600> *</font></TD>
</TR>
<TR>
<TD id=mainfoot colSpan=2 height="30">
<div align="center">
<table width="30%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25">
<div align="center">
<input name=submit2 type=image src="../IMAGES/pics/s_button000.gif" alt=进入 align=absMiddle width="45" height="20" cache tppabs="" >
</div></td>
<td>
<div align="center">
<input type="reset" value="全部重写" name="B22" class=input>
</div></td>
</tr>
</table>
</div></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
</form>
</body>
<%
sub lanyuhtml(addr,w,h)
Response.write("<IFRAME name='i1' src='"&addr&"'; frameBorder=0 width="&w&" scrolling=no height="&h&"> </IFRAME>")
end sub%>