WebRoot/admin/ad-up2.jsp

(完整代码) 944B

<%@ page contentType="text/html; charset=utf-8" import="java.sql.*"%>
<html>
<jsp:useBean id="dd" scope="session" class="stu.admin"/>
<head>
<title>管理员页面</title>
</head>
<body>
<br><br><br>
 <% 
	request.setCharacterEncoding("utf-8");
	String id=dd.getid();
	String tel=request.getParameter("tel");
	String passw=request.getParameter("passw"); 
	
	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="update admin set tel='"+tel+"',password='"+passw+"' where id='"+id+"'";
	int i=state.executeUpdate(sql);
	if(i==1){
	%>
	<div align=center>
	<h2>个人信息修改成功!</h2>
	<% }else{%>
	<h2>个人信息修改失败!</h2></div>
<% 	}
	state.close();conn.close();
	 
	
	%>

</body>
</html>

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。