forked from bhum1k99/HACKNITRR-SPARTANS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit_profile.php
80 lines (80 loc) · 3.28 KB
/
edit_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
<?php
session_start();
$connection = mysqli_connect("localhost", "root", "");
$db = mysqli_select_db($connection,"eventon");
$fname = "";
$lname = "";
$email = "";
$password = "";
$semester = "";
$branch = "";
$query = "select * from users where email = '$_SESSION[email]'";
$query_run = mysqli_query($connection,$query);
while($row = mysqli_fetch_assoc($query_run)){
$fname = $row['fname'];
$lname = $row['lname'];
$email = $row['email'];
$password = $row['password'];
$semester = $row['semester'];
$branch = $row['branch'];
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="" method="post">
<div class="form-group">
<label>First Name:</label>
<input type="text" class="form-control" name="fname" value="<?php echo $fname;?>">
</div>
<div class="form-group">
<label>Last Name:</label>
<input type="text" class="form-control" name="lname" value="<?php echo $lname;?>">
</div>
<div class="form-group">
<label>Email:</label>
<input type="text" class="form-control" name="email" value="<?php echo $email;?>">
</div>
<div class="form-group">
<label>Password:</label>
<input type="text" class="form-control" name="password" value="<?php echo $password;?>">
</div>
<div class="form-group">
<label>Select Semester:</label>
<select class="form-control" name="semester" required>">
<option><?php echo $class;?></option>
<option>First</option>
<option>Second</option>
<option>Third</option>
<option>Fourth</option>
<option>Fifth</option>
<option>Sixth</option>
<option>Seventh</option>
<option>Eigth</option>
</select>
</div>
<div class="form-group">
<label>Select Branch:</label>
<select class="form-control" name="branch" required>">
<option><?php echo $class;?></option>
<option>Bio Medical Engineering</option>
<option>Bio Technology</option>
<option>Chemical Engineering</option>
<option>Civil Engineering</option>
<option>Computer Science & Engineering</option>
<option>Electrical Engineering</option>
<option>Electronics and Communication Engineering</option>
<option>Information Technology</option>
<option>Mechanical Engineering</option>
<option>Mining Engineering</option>
<option>Metallurgical and Materials Engineering</option>
</select>
</div>
<button type="submit" name="update_profile" class="btn btn-primary">Update</button>
</form>
</body>
</html>