主页:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加主题--管理后台</title>
<link href="CSS/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<div id="welcome">欢迎使用新闻管理系统!</div>
<div id="nav">
<div id="logo"><img src="Images/logo.jpg" alt="新闻中国" /></div>
<div id="a_b01"><img src="Images/a_b01.gif" alt="" /></div>
</div>
</div>
<div id="admin_bar">
<div id="status">管理员: 登录      <a href="newspages/up_news">login out</a></div>
<div id="channel"> </div>
</div>
<div id="main">
<div id="opt_list">
<ul>
<li><a href="newspages/add_news.jsp?wid=<%=request.getParameter("wid") %>">添加新闻</a></li>
<li><a href="admin.jsp?wid=<%=request.getParameter("wid") %>">编辑新闻</a></li>
<li><a href="admin.jsp?wid=<%=request.getParameter("wid") %>">查找新闻</a></li>
<li><a href="newspages/add_sub.jsp?wid=<%=request.getParameter("wid") %>">添加主题</a></li>
<li><a href="newspages/up_news.jsp?wid=<%=request.getParameter("wid") %>">编辑主题</a></li>
<li><a href="dodele.jsp?wid=<%=request.getParameter("wid") %>">删除主题</a></li>
</ul>
</div>
<div id="opt_area">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<script language="javascript">
function clickdel(){
return confirm("删除请点击确认");
}
</script>
<form action="doupdate.jsp?wid=<%=request.getParameter("wid") %>" align="center">
<input type="text" name = "str">
<input type="submit" value="查询">
</form>
<ul class="classlist">
<%
Class.forName("oracle.jdbc.OracleDriver");
String url = "jdbc:oracle:thin:@localhost:1521:orcl";
Connection con = DriverManager.getConnection(url,"scott","tiger");
PreparedStatement ps = con.prepareStatement("select * from news nid order by desc");
ResultSet rs = ps.executeQuery();
while(rs.next()){
%>
<li>
<a href="newspages/news_read.jsp?nid=<%=rs.getInt(1)%>&wid=<%=request.getParameter("textfield") %>">
<%=rs.getString("ntitle") %>
</a> <span> 作者:
<%=rs.getString("nzz") %>
     <a href='update_news.jsp?nid=<%=rs.getInt(1)%>&ntid=<%=rs.getInt(2) %>&wid=<%=request.getParameter("wid") %>'>修改</a>      <a href='dodelnews.jsp' onclick='return clickdel()'>删除</a> </span> </li>
<li class='space'></li>
<%
}
%>
<p align="right"> 当前页数:[1/3] <a href="#">下一页</a> <a href="#">末页</a> </p>
</ul>
</div>
</div>
<div id="site_link"> <a href="#">关于我们</a><span>|</span> <a href="#">Aboue Us</a><span>|</span> <a href="#">联系我们</a><span>|</span> <a href="#">广告服务</a><span>|</span> <a href="#">供稿服务</a><span>|</span> <a href="#">法律声明</a><span>|</span> <a href="#">招聘信息</a><span>|</span> <a href="#">网站地图</a><span>|</span> <a href="#">留言反馈</a> </div>
<div id="footer">
<p class="">24小时客户服务热线:010-68988888      <a href="#">常见问题解答</a>      新闻热线:010-627488888<br />
文明办网文明上网举报电话:010-627488888      举报邮箱:<a href="#">jubao@jb-aptech.com.cn</a></p>
<p class="copyright">Copyright © 1999-2009 News China gov, All Right Reserver<br />
新闻中国 版权所有</p>
</div>
</body>
</html>
增:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加主题--管理后台</title>
<link href="../CSS/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<div id="welcome">欢迎使用新闻管理系统!</div>
<div id="nav">
<div id="logo"><img src="../Images/logo.jpg" alt="新闻中国" /></div>
<div id="a_b01"><img src="../Images/a_b01.gif" alt="" /></div>
</div>
</div>
<div id="admin_bar">
<div id="status">管理员: 登录     <a href="#">login out</a></div>
<div id="channel"> </div>
</div>
<div id="main">
<div id="opt_list">
<ul>
<li><a href="add_news.jsp?wid=<%=request.getParameter("wid")%>">添加新闻</a></li>
<li><a href="../admin.jsp?wid=<%=request.getParameter("wid")%>">编辑新闻</a></li>
<li><a href="../admin.jsp?wid=<%=request.getParameter("wid")%>">查找新闻</a></li>
<li><a href="add_sub.jsp?wid=<%=request.getParameter("wid")%>">添加主题</a></li>
<li><a href="update_sub.jsp?wid=<%=request.getParameter("wid")%>">编辑主题</a></li>
<li><a href="../dodele.jsp?wid=<%=request.getParameter("wid")%>">删除主题</a></li>
</ul>
</div>
<div id="opt_area">
<h1 id="opt_type"> 添加主题: </h1>
<form action="doadd_news.jsp?wid=<%=request.getParameter("wid") %>" method="post">
<p>
<label> 主题: </label>
<input name="nauthor" type="text" class="opt_input" />
</p>
<input name="action" type="hidden" value="addnews">
<input type="submit" value="提交" class="opt_sub" />
<input type="reset" value="重置" class="opt_sub" />
</form>
</div>
</div>
<div id="site_link"> <a href="#">关于我们</a><span>|</span> <a href="#">Aboue Us</a><span>|</span> <a href="#">联系我们</a><span>|</span> <a href="#">广告服务</a><span>|</span> <a href="#">供稿服务</a><span>|</span> <a href="#">法律声明</a><span>|</span> <a href="#">招聘信息</a><span>|</span> <a href="#">网站地图</a><span>|</span> <a href="#">留言反馈</a> </div>
<div id="footer">
<p class="">24小时客户服务热线:010-68988888      <a href="#">常见问题解答</a>      新闻热线:010-627488888<br />
文明办网文明上网举报电话:010-627488888      举报邮箱:<a href="#">jubao@jb-aptech.com.cn</a></p>
<p class="copyright">Copyright © 1999-2009 News China gov, All Right Reserver<br />
新闻中国 版权所有</p>
</div>
</body>
</html>
删:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>删除主题--管理后台</title>
<link href="CSS/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<div id="welcome">欢迎使用新闻管理系统!</div>
<div id="nav">
<div id="logo"><img src="images/logo.jpg" alt="新闻中国" /></div>
<div id="a_b01"><img src="images/a_b01.gif" alt="" /></div>
</div>
</div>
<div id="admin_bar">
<div id="status">管理员: 登录     <a href="login.jsp"><%=request.getParameter("wid") %></a></div>
<div id="channel"> </div>
</div>
<div id="main">
<div id="opt_list">
<ul>
<li><a href="newspages/add_news.jsp?wid=<%=request.getParameter("wid") %>">添加新闻</a></li>
<li><a href="admin.jsp?wid=<%=request.getParameter("wid") %>">编辑新闻</a></li>
<li><a href="admin.jsp?wid=<%=request.getParameter("wid") %>">查找新闻</a></li>
<li><a href="newspages/add_sub.jsp?wid=<%=request.getParameter("wid") %>">添加主题</a></li>
<li><a href="newspages/update_sub.jsp?wid=<%=request.getParameter("wid") %>">编辑主题</a></li>
<li><a href="dodele.jsp?wid=<%=request.getParameter("wid") %>">删除主题</a></li>
</ul>
</div>
<div id="opt_area">
<h1 id="opt_type"> 删除主题: </h1>
<form action="dodelenews.jsp?win=<%=request.getParameter("wid") %>" method="post" onsubmit='return clickdel()'>
<script language="javascript">
function clickdel(){
return confirm("删除请点击确认");
}
</script>
<p>
<label> 主题: </label>
<select name="ntid">
<%
Class.forName("oracle.jdbc.driver.OracleDriver");
//2、连接数据库
String url = "jdbc:oracle:thin:@localhost:1521:ORCL";
Connection con = DriverManager.getConnection(url, "scott", "tiger");
//3、定义那个对象,用来执行sql语句
PreparedStatement ps = con.prepareStatement("select * from subject");
ResultSet rs=ps.executeQuery();
while(rs.next()){
%>
<option value="<%=rs.getInt(1)%>"><%=rs.getString(2) %></option>
<% }%>
</select>
</p>
<input name="action" type="hidden" value="addnews">
<input type="submit" value="删除" class="opt_sub" />
<input type="reset" value="重置" class="opt_sub" />
</form>
</div>
</div>
<div id="site_link"> <a href="#">关于我们</a><span>|</span> <a href="#">Aboue Us</a><span>|</span> <a href="#">联系我们</a><span>|</span> <a href="#">广告服务</a><span>|</span> <a href="#">供稿服务</a><span>|</span> <a href="#">法律声明</a><span>|</span> <a href="#">招聘信息</a><span>|</span> <a href="#">网站地图</a><span>|</span> <a href="#">留言反馈</a> </div>
<div id="footer">
<p class="">24小时客户服务热线:010-68988888      <a href="#">常见问题解答</a>      新闻热线:010-627488888<br />
文明办网文明上网举报电话:010-627488888      举报邮箱:<a href="#">jubao@jb-aptech.com.cn</a></p>
<p class="copyright">Copyright © 1999-2009 News China gov, All Right Reserver<br />
新闻中国 版权所有</p>
</div>
</body>
</html>
改:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改主题--管理后台</title>
<link href="../CSS/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<div id="welcome">欢迎使用新闻管理系统!</div>
<div id="nav">
<div id="logo"><img src="../images/logo.jpg" alt="新闻中国" /></div>
<div id="a_b01"><img src="../images/a_b01.gif" alt="" /></div>
</div>
</div>
<div id="admin_bar">
<div id="status">管理员: 登录     <a href="#"><%=request.getParameter("wid") %></a></div>
<div id="channel"> </div>
</div>
<div id="main">
<div id="opt_list">
<ul>
<li><a href="add_news.jsp?wid=<%=request.getParameter("wid")%>">添加新闻</a></li>
<li><a href="../admin.jsp?wid=<%=request.getParameter("wid")%>">编辑新闻</a></li>
<li><a href="../admin.jsp?wid=<%=request.getParameter("wid")%>">查找新闻</a></li>
<li><a href="add_sub.jsp?wid=<%=request.getParameter("wid")%>">添加主题</a></li>
<li><a href="up_news.jsp?wid=<%=request.getParameter("wid")%>">编辑主题</a></li>
<li><a href="../dodele.jsp?wid=<%=request.getParameter("wid")%>">删除主题</a></li>
</ul>
</div>
<div id="opt_area">
<h1 id="opt_type"> 修改主题: </h1>
<form action="doupdate.jsp?wid=<%=request.getParameter("wid") %>" method="post">
<p>
<label> 主题: </label>
<select name="ntid">
<%
Class.forName("oracle.jdbc.driver.OracleDriver");
//2、连接数据库
String url = "jdbc:oracle:thin:@localhost:1521:ORCL";
Connection con = DriverManager.getConnection(url, "scott", "tiger");
//3、定义那个对象,用来执行sql语句
PreparedStatement ps = con.prepareStatement("select * from subject");
ResultSet rs=ps.executeQuery();
while(rs.next()){
%>
<option value="<%=rs.getInt(1)%>"><%=rs.getString(2) %></option>
<% }%>
</select>
<input name="nauthor" type="text" class="opt_input" />
</p>
<input name="action" type="hidden" value="addnews">
<input type="submit" value="修改" class="opt_sub" />
<input type="reset" value="重置" class="opt_sub" />
</form>
</div>
</div>
<div id="site_link"> <a href="#">关于我们</a><span>|</span> <a href="#">Aboue Us</a><span>|</span> <a href="#">联系我们</a><span>|</span> <a href="#">广告服务</a><span>|</span> <a href="#">供稿服务</a><span>|</span> <a href="#">法律声明</a><span>|</span> <a href="#">招聘信息</a><span>|</span> <a href="#">网站地图</a><span>|</span> <a href="#">留言反馈</a> </div>
<div id="footer">
<p class="">24小时客户服务热线:010-68988888      <a href="#">常见问题解答</a>      新闻热线:010-627488888<br />
文明办网文明上网举报电话:010-627488888      举报邮箱:<a href="#">jubao@jb-aptech.com.cn</a></p>
<p class="copyright">Copyright © 1999-2009 News China gov, All Right Reserver<br />
新闻中国 版权所有</p>
</div>
</body>
</html>