?? delete.jsp
字號:
?
+
<%@ page contentType="text/html;charset=GB2312" %><%@ page import="java.sql.*" %><%@ page import="yy.Login" %><jsp:useBean id="login" class="Login" scope="session" ></jsp:useBean><% //如果客戶直接進入該頁面將被轉向登錄頁面。 if(session.isNew()) {response.sendRedirect("login.jsp"); } //如果沒有成功登錄將被轉向登錄頁面 String success=login.getSuccess(); if(success==null) {success=""; } if(!(success.equals("ok"))) {response.sendRedirect("login.jsp"); }%><HTML><BODY ><Font size=3><table align="center" border="0" width="790" height="12" bgcolor=cyan cellspacing="0"> <tr><td width="100%"><a href="<%=response.encodeURL("showMember.jsp")%>">瀏覽會員</a> | <a href="<%=response.encodeURL("register.jsp")%>">會員注冊</a> | <a href="<%=response.encodeURL("login.jsp")%>">會員登錄 </a> |<a href="<%=response.encodeURL("find.jsp")%>">查找會員 </a> | <a href="<%=response.encodeURL("Message.jsp")%>">留言板</a>|<a href="<%=response.encodeURL("publicMessage.jsp")%>">查看公共留言</a>|<a href="<%=response.encodeURL("secretMessage.jsp")%>">查看私人留言</a>|<a href="<%=response.encodeURL("modifyPassword.jsp")%>">修改密碼 </a> |<a href="<%=response.encodeURL("modifyMessage.jsp")%>">修改個人信息 </a>| </td> </tr> </table></table> <% //獲取提交的信息的時間: String time=request.getParameter("time"); if(time==null) {time=""; } byte b[]=time.getBytes("ISO-8859-1"); time=new String(b); Connection con=null; Statement sql=null; ResultSet rs=null; try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(ClassNotFoundException event){} try {con=DriverManager.getConnection("jdbc:odbc:friend","sa",""); sql=con.createStatement(); //刪除操作: String s=login.getLogname(); String condition1= "DELETE FROM secretwordpad WHERE logname ="+"'"+s+"'"; String condition2= "AND time ="+"'"+time+"'"; String condition=condition1+condition2; sql.executeUpdate(condition); out.print("刪除了該留言"); con.close(); } catch(SQLException event) {out.print(""+event); }%></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -