📄 addfile.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@include file="getusersession.jsp"%>
<%
request.setCharacterEncoding("GB2312");
%>
<jsp:useBean id="addfile" scope="page" class="dsp.database.Operation"/>
<%
//所有二级栏目
String sql = "SELECT * FROM web_class WHERE flag<>0 ORDER BY id ASC";
ResultSet rs = addfile.query(sql);
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="inc/admin.css" rel="stylesheet" type="text/css">
<script language = "JavaScript">
<!--
var onecount;
onecount=0;
subcat = new Array();
<%
int count = 0;
while(rs.next()){
%>
subcat[<%=count%>] = new Array("<%=rs.getString("classname")%>","<%=rs.getInt("flag")%>","<%=rs.getInt("id")%>");
<%
count = count + 1;
}
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form1.second.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.second.options[document.form1.second.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
//-->
</script>
</head>
<body>
<table width="95%" border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#ECEEE4" bordercolordark="#CCCABC">
<tr>
<td colspan="7" align="center" height="30" background="images/tablebg.gif"><b>添
加 文 件</b></td>
</tr>
<form name="form1" method="post" action="processaddfile.jsp">
<tr>
<td width="17%" height="25"><div align="right">栏目<font color="#FF0000">*</font></div></td>
<td width="83%" height="25"><select name="first" id="first" onChange="javascript:changelocation(document.form1.first.options[document.form1.first.selectedIndex].value)">
<option selected>一级栏目</option>
<%
//一级栏目
sql = "SELECT * FROM web_class WHERE flag=0 ORDER BY id ASC";
rs = addfile.query(sql);
%>
<%
while(rs.next()){
%>
<option value="<%=rs.getInt("id")%>"><%=rs.getString("classname")%></option>
<%}%>
</select> <select name="second" id="second">
<option value="0" selected>二级栏目</option>
</select></td>
</tr>
<tr>
<td height="25" align="center"><div align="right">名称<font color="#FF0000">*</font></div></td>
<td height="25" align="center"><div align="left">
<input name="title" type="text" id="title" size="30" maxlength="80">
</div></td>
</tr>
<tr>
<td height="25" align="center"><div align="right">简介</div></td>
<td height="25" align="center"><div align="left">
<textarea name="information" cols="40" rows="8" id="information"></textarea>
</div></td>
</tr>
<tr>
<td height="25" align="center"><div align="right">文件<font color="#FF0000">*</font></div></td>
<td align="center"><div align="left">
<iframe name="ad" src="uploadfile.jsp" width="450" height="25" frameborder=0 scrolling=no>
</iframe>
</div>
</td>
</tr>
<tr>
<td height="6" colspan="2" align="center"><input type="submit" name="Submit" value="提交">
<input name="reset" type="reset" id="reset" value="重置"> <input name="filename" type="hidden" id="filename">
<input name="size" type="hidden" id="size"></td>
</tr>
<tr>
<td height="7" colspan="2" align="center"><font color="#FF0000">注意</font>:文件上传成功之后才能提交!</td>
</tr>
</form>
</table>
<%@include file="copyright.jsp"%>
</body>
</html>
<%
addfile.closestmt();
addfile.closeconn();
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -