Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page import="java.io.*,java.util.*,java.sql.*"%>
- <%@ page import="javax.servlet.http.*,javax.servlet.*" %>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Insert title here</title>
- </head>
- <body>
- <sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
- url="jdbc:mysql://localhost/usersinfo"
- user="root" password="Slnm1855"/>
- <sql:query dataSource="${snapshot}" var="result">
- select * from members where username ='${param.delUname}';
- </sql:query>
- <c:choose>
- <c:when test="${param.pass==result.rows[0].password}">
- <%session.setAttribute("user", request.getParameter("delUname")); %>
- <sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/usersinfo" user="root" password="Slnm1855"/>
- <sql:query dataSource="${snapshot}" var="result">
- SELECT * FROM members;
- </sql:query>
- <sql:update dataSource="${snapshot}" var="delete">
- DELETE FROM members WHERE username = '${param.delUname}'
- </sql:update>
- <%response.sendRedirect("SQLHomePageLogin.jsp"); %>
- </c:when>
- <c:otherwise>
- <%response.sendRedirect("deleteUser.jsp"); %>
- </c:otherwise>
- </c:choose>
- </body>
- </html>
Add Comment
Please, Sign In to add comment