-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.php
116 lines (81 loc) · 2.11 KB
/
profile.php
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php include "includes/header.php"; ?>
<!-- end of menu tab -->
<?php include "includes/left.php"; ?>
<!-- end of left content -->
<div class="center_content">
<div class="center_title_bar">Profile</div>
<?php
$mid=$_SESSION['mid'];
if(isset($_POST['submit'])){
$name=$_POST['name'];
$contact=$_POST['contact'];
$address=$_POST['address'];
$gender=$_POST['gender'];
$q="UPDATE members SET
name='$name',
contact='$contact',
address='$address',
gender='$gender'
WHERE mid='$mid'
";
//echo $q;
//die();
$mysqli->query($q);
echo "Successfully Updated";
}
$r=$mysqli->query("SELECT * FROM members WHERE mid='$mid'");
$row=$r->fetch_assoc();
?>
<form action="" method="post">
<table width="100%" height="323" border="0">
<tr>
<td width="27%">Name</td>
<td width="73%"><input type="text" name="name"
value="<?php echo $row['name']; ?>"
/></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" disabled="disabled"
value="<?php echo $row['email']; ?>"
/></td>
</tr>
<tr>
<td>Contact</td>
<td><input type="text" name="contact" value="<?php echo $row['contact']; ?>" /></td>
</tr>
<tr>
<td>Address</td>
<td><input type="text" name="address"
value="<?php echo $row['address']; ?>"
/></td>
</tr>
<tr>
<td>Gender</td>
<td><input
<?php
if($row['gender']=='male'){
echo "checked=checked";
}
?> type="radio" name="gender" value="male" /> Male <br />
<input type="radio"
<?php
if($row['gender']=='female'){
echo "checked=checked";
}
?> name="gender" value="female" /> Female <br />
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="Update" /></td>
</tr>
</table>
</form>
</div>
<!-- end of center content -->
<?php include "includes/right.php"; ?>
<!-- end of right content -->
</div>
<!-- end of main content -->
<?php include "includes/footer.php"; ?>