editFile.jsp
资源名称:wapjsp.rar [点击查看]
上传用户:xiao85513
上传日期:2010-01-11
资源大小:2160k
文件大小:3k
源码类别:
手机WAP编程
开发平台:
Java
- <%@ page import="java.sql.*"%>
- <%@ taglib uri="http://herald.seu.edu.cn/yiwen" prefix="cyndi"%>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>艺文频道管理系统</title>
- <style type="text/css">
- a:{text-decoration:none;color:gray}
- a:link{text-decoration:none;color:gray}
- a:visited{text-decoration:none;color:gray}
- A:hover {text-decoration:none;color:red}
- </style>
- <script>
- function check()
- {
- /*var t=document.all.item("msgformat").value;
- if(t!="")
- {
- while(t.indexOf("rn")>0)t=t.replace("rn","<br>");
- document.all.item("content").value=t;
- return true;
- }*/
- if(document.all.item("title").value==""||document.all.item("filepath").value=="")
- {
- alert("下载标题和下载地址不能为空!");
- return false;
- }
- else return true;
- }
- function uploadfile()
- {
- open('../compent/uploadfile/upload.jsp','上传','height=150,width=250');
- }
- </script>
- </head>
- <body>
- <jsp:useBean id="item" scope="page" class="beanclass.AddFileBean"/>
- <jsp:setProperty name="item" property="*"/>
- <%if(item.getTitle()!=null){String str="update class"+item.getBigname()+" set title='"+item.getTitle()+"',content='"+item.getContent()+"',filepath='"+item.getFilepath()+"' where id="+item.getId();%><cyndi:sqlexecute sql="<%=str%>"/><script>alert("修改成功!");</script><%}%>
- <form METHOD=POST ACTION="editFile.jsp?id=<%=item.getId()%>" onsubmit="return check();">
- <input type=text style="display:none" name=bigname value="<%=item.getBigname()%>"><input type=text style="display:none" name=smallname value="<%=item.getSmallname()%>">
- <table border="0" width="80%" align=center bgcolor="#000000" cellspacing="1" cellpadding="3">
- <tr bgcolor="#abb8d6">
- <td colspan="2" height="55">
- <div align="center"><b>修 改 内 容</b></div>
- </td>
- </tr>
- <tr bgcolor="#FFFFFF">
- <td align="right" bgcolor="#FFFFFF">所属栏目:</td>
- <td style="color:red">
- <%Class.forName("org.gjt.mm.mysql.Driver").newInstance();
- String url ="jdbc:mysql://localhost/javagame?user=nangua&password=2003herald&useUnicode=true&characterEncoding=8859_1";
- Connection con= DriverManager.getConnection(url);
- Statement statement=con.createStatement();
- ResultSet rs=statement.executeQuery("select classname from bigclass where id="+item.getBigname());
- if(rs.next()){
- %>
- <%=rs.getString("classname")%><%rs.close();rs=statement.executeQuery("select classname from smallclass where id="+item.getSmallname());if(rs.next()){%>--><%=rs.getString("classname")%><%}rs.close();}else{%>出现异常,请与管理员联系<%rs.close();}%>
- </td>
- </tr>
- <%rs=statement.executeQuery("select * from class"+item.getBigname()+" where id="+item.getId());
- if(rs.next()){%>
- <tr bgcolor="#FFFFFF">
- <td align="right">下载标题:</td>
- <td>
- <input type="text" name="title" size=50 value=<%=rs.getString("title")%>>
- </td>
- </tr>
- <!--
- <tr bgcolor="#CCCCCC" align="center" valign="bottom">
- <td align="right" valign="top" bgcolor="#FFFFFF" >下载介绍:</td>
- <td bgcolor="#FFFFFF" align="left">
- <textarea name=msgformat style="width:450;height:350"><%=rs.getString("content")%></textarea>
- <textarea name="content" style="display:none"></textarea>
- </td>
- </tr>-->
- <tr bgcolor="#FFFFFF">
- <td align="right">下载地址:</td>
- <td>
- <input type="text" name="filepath" size=50 value=<%=rs.getString("filepath")%>> <a href="javascript:uploadfile();">上传JAVA游戏</a>
- </td>
- </tr>
- <tr bgcolor="#abb8d6">
- <td colspan="2" align="center" height="30">
- <input type="submit" value=" 添 加 ">
-
- <input type="reset" value=" 清 空">
- </td>
- </tr>
- <%rs.close();}statement.close();con.close();%>
- </table>
- </form>
- </body>
- </html>