-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforgetpass_fp2.java
More file actions
69 lines (63 loc) · 1.98 KB
/
forgetpass_fp2.java
File metadata and controls
69 lines (63 loc) · 1.98 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
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 fp2 extends HttpServlet
{
public void doPost(HttpServletRequest req,
HttpServletResponse res)throws IOException, ServletException
{
res.setContentType("text/html");
PrintWriter pwl=res.getWriter();
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+"'";
ResultSet rs = stmt.executeQuery(q1);
if(rs.next())
{
pwl.println("\n" +
"<html>\n" +
" <head>\n" +
" <title></title>\n" +
" \n" +
" </head>\n" +
" <body bgcolor=\"lightgreen\">\n" +
" <h1>\n" +
" SECURITY QUESTION\n" +
" </h1>\n" +
" <form method=\"post\" action=\"fp3\">\n" +
" Answer: <input type=\"text\" name=\"n1\" placeholder=\"Enter your ans..\">\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);
}
}
}