Yuvalxp8

Deletes The Verified Account (Using MySQL)

Apr 4th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 1.59 KB | None | 0 0
  1. <%@ page import="java.io.*,java.util.*,java.sql.*"%>
  2. <%@ page import="javax.servlet.http.*,javax.servlet.*" %>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
  5. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  6.     pageEncoding="ISO-8859-1"%>
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  11. <title>Insert title here</title>
  12. </head>
  13. <body>
  14. <sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
  15.      url="jdbc:mysql://localhost/usersinfo"
  16.      user="root"  password="Slnm1855"/>
  17.      
  18. <sql:query dataSource="${snapshot}" var="result">
  19. select * from members where username ='${param.delUname}';
  20. </sql:query>
  21.  
  22.    
  23.  
  24.  
  25. <c:choose>
  26.     <c:when test="${param.pass==result.rows[0].password}">
  27.         <%session.setAttribute("user", request.getParameter("delUname")); %>
  28.     <sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/usersinfo" user="root"  password="Slnm1855"/>
  29.    <sql:query dataSource="${snapshot}" var="result">
  30.         SELECT * FROM members;
  31.     </sql:query>
  32. <sql:update dataSource="${snapshot}" var="delete">
  33.     DELETE FROM members WHERE username = '${param.delUname}'
  34. </sql:update>
  35.         <%response.sendRedirect("SQLHomePageLogin.jsp"); %>
  36.  
  37.        
  38.     </c:when>
  39.     <c:otherwise>
  40.         <%response.sendRedirect("deleteUser.jsp"); %>
  41.     </c:otherwise>
  42. </c:choose>
  43. </body>
  44. </html>
Add Comment
Please, Sign In to add comment