WebRoot/admin/stu-del.jsp
(完整代码) 805B<%@ page contentType="text/html; charset=utf-8" import="java.sql.*"%>
<html>
<head>
<title>管理员页面</title>
</head>
<body>
<div align=center>
<%
request.setCharacterEncoding("utf-8");
String id=request.getParameter("id");
String user="root";
String password="root";
String url="jdbc:mysql://localhost:3306/JSFP";
Class.forName("com.mysql.jdbc.Driver");
Connection conn=DriverManager.getConnection(url,user,password);
Statement state=conn.createStatement();
String sql="delete from student where id='"+id+"'";
int i=state.executeUpdate(sql);
if(i==1){
%>
<br><br><br><br>
<div align=center>
<h2>该信息删除成功!</h2>
<%
}else{
%>
<h2>该信息删除失败!</h2>
</div>
<%
}
state.close();
conn.close();
%>
</div>
</body>
</html>
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
