-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforgetpass_fp3.java
More file actions
71 lines (65 loc) · 2.08 KB
/
forgetpass_fp3.java
File metadata and controls
71 lines (65 loc) · 2.08 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import java.io.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.servlet.*;
import javax.servlet.http.*;
public class fp3 extends HttpServlet
{
public void doPost(HttpServletRequest req,
HttpServletResponse res)throws IOException, ServletException
{
res.setContentType("text/html");
PrintWriter pwl=res.getWriter();
String ans=req.getParameter("n1");
String mail=req.getParameter("Email");
//pwl.println
//("<html><body bgcolor=lightyellow><h1>Security Question<h1><br><br> </body></html>");
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","system","manager");
Statement stmt = con.createStatement();
String q1 = "select * from e_reg1 where email='"+mail+"' and answer='"+ans+"'";
pwl.println(q1);
ResultSet rs = stmt.executeQuery(q1);
if(rs.next())
{
pwl.println("\n" +
"<html>\n" +
" <head>\n" +
" <title></title>\n" +
" \n" +
" </head>\n" +
" <body bgcolor=\"lighyellow\">\n" +
" <h1>\n" +
" NEW PASSWORD SETUP\n" +
" </h1>\n" +
" <form method=\"post\" action=\"fp4\">\n" +
" New Password: <input type=\"password\" name=\"n1\" placeholder=\"Enter new password..\">\n" +
" <br>\n" +
" <br>\n" +
" \n" +
" Email: <input type=\"email\" name=\"Email\" placeholder=\"Enter your mail id\">\n" +
" <br>\n" +
" <br>\n" +
" \n" +
" <input type=\"submit\" value=\"Submit\">\n" +
" \n" +
" </form>\n" +
" </body>\n" +
"</html>\n" +
"");
}
else
{
pwl.println("not found");
}
con.close();
}
catch(Exception e)
{
pwl.println(e);
}
}
}