forked from kishanrajput23/Java-Projects-Collections
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchangeprofile.jsp
94 lines (70 loc) · 1.49 KB
/
changeprofile.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<jsp:useBean id="user" scope="session" class="obs.User"/>
<jsp:setProperty name="user" property="*" />
<%
if (!user.isLogged())
response.sendRedirect("login.html");
%>
<html>
<style>
h2{color:bottlegreen;font:700 16pt arial}
h3{color:navy;font:700 12pt arial}
td {font:10pt verdana}
a {font:10pt verdana;color:bottlegreen}
body {font:10pt verdana}
</style>
<body bgcolor="beige">
<h2>Change Profile </h2>
<form action="changeprofile.jsp" method="post">
<h3>Personal Details </h3>
<table>
<tr>
<td>
Email Address
<td>
<input type=text name=email size=30 value=<%=user.getEmail()%>>
</tr>
<tr>
<td>Mailing Address
<td>
<textarea name="address" rows=3 cols=30><%=user.getAddress()%></textarea>
</td>
</tr>
<tr>
<td>
Phone Number
<td>
<input type=text name=phone size=30 value='<%=user.getPhone()%>'>
</tr>
</table>
<h3>Password </h3>
<table>
<tr>
<td>
New Password
<td>
<input type=password name=pwd size=20>
</tr>
<tr>
<td>
Confirm Password
<td>
<input type=password name=pwd2 size=20>
</tr>
</table>
<p>
<input type=submit value="Update Profile">
<input type=reset value="Reset"> <a href="home.jsp">Home Page</a>
</form>
<%
// do it if any invoked by itself
if ( request.getParameter("email") == null)
return;
String res = user.updateProfile( request.getParameter("pwd") );
if ( res == null)
out.println("Profile Updated Successfully.");
else
out.println("Error : " + res);
out.println("Click <a href=home.jsp>here</a> to continue...");
%>
</body>
</html>