📄 drop.jsp
字号:
<%@ 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="";
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");
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -