?? drop.jsp
字號(hào):
<%@ page contentType="text/html; charset=gb2312" language="java"
import="java.sql.*" errorPage=""%>
<%
String pass = null;
pass = (String) session.getAttribute("pass");
if ("y".equals(pass)) {
String id = request.getParameter("id");
if (id == null) {
out.print("<h3><font color=#FF0000>ERROR!</font></h3>");
} else {
String host = "localhost";
String user = "root";
String pw = "123";
String db = "numb1";
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url = "jdbc:mysql://" + host + "/" + db;
Connection con = DriverManager.getConnection(url, user, pw);
java.sql.Statement st = con.createStatement();
String sql = "delete from lyb where id=" + id;
st.executeUpdate(sql);
st.close();
con.close();
response.sendRedirect("index.jsp");
}
} else {
response.sendRedirect("log.jsp");
}
%>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -