-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_password.jsp
25 lines (24 loc) · 968 Bytes
/
update_password.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<sql:setDataSource var="dbsource" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1/login"
user="root" password=""/>
<sql:update dataSource="${dbsource}" var="count">
UPDATE users SET password = ?
WHERE uname='${param.uname}'
<sql:param value="${param.new_password}" />
</sql:update>
<c:if test="${count>=1}">
<% response.sendRedirect("profile.jsp?Password Changed Successfully"); %>
</c:if>>
</body>
</html>