-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstudentUpdate.php
More file actions
117 lines (96 loc) · 4.47 KB
/
studentUpdate.php
File metadata and controls
117 lines (96 loc) · 4.47 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
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
117
<?php
session_start();
if(isset($_POST['submit'])){
$id= $_SESSION['id'];
require_once('./Config.php');
// $server= "localhost";
// $username="root";
// $password="";
// $con= mysqli_connect($server,$username,$password,'dowell university');
// if(!$con){
// die("Connection not made due to".mqsqli_connect_error());
// }
$fname= $_POST['fname'];
$lname = $_POST['lname'];
$email= $_POST['email'];
$phone = $_POST['ph'];
$dob = $_POST['dob'];
$address = $_POST['adderess'];
echo $lname;
//query to update student details
$query = "UPDATE students SET FirstName='$fname', LastName='$lname',Email='$email',PhoneNumber='$phone',DOB='$dob',Adderess='$address' WHERE sid='$id' ";
if($con->query($query)){
$_SESSION['username']=$fname;
header('location: ./Student Dashborad.php');
}
else{
echo "There was an error updating details";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Update Form</title>
</head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/momentjs/2.14.1/moment.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
<script>
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
<link rel="stylesheet" href="Registration.css"/>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<body style="background-color:#fff">
<form id="regform" method="post">
<h2 style="margin-left:680px">Update</h2>
<div style="margin-top:35px;background-color:#E27D60;border-radius: 5px;box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);overflow: hidden;width: 400px;max-width: 100%;" class="container">
<div class="form-row">
<div class="col">
<label for="fname">First Name</label>
<input type="text" class="form-control" placeholder="First Name" id="fname" name="fname" required/>
</div>
</div>
<div class="form-row">
<div class="col">
<label for="lname">Last Name</label>
<input type="text" class="form-control" placeholder="Last Name" id="lname" name="lname" required/>
</div>
</div>
<div class="form-row">
<div class="col">
<label for="email">Email</label>
<input type="email" class="form-control" placeholder="Email" id="email" name="email" required/>
</div>
</div>
<div class="form-row">
<div class="col">
<label for="ph">Phone Number</label>
<input type="text" class="form-control" placeholder="Phone Number" id="ph" name="ph" required/>
</div>
</div>
<div class="form-row">
<div class="col">
<label for="adderess">Adderess</label>
<input type="text" class="form-control" placeholder="Adderess" id="adderess" name="adderess" required/>
</div>
</div>
<div class="form-row">
<div class="col">
<label for="dob">Date OF Birth</label>
<input type="date" class="form-control" placeholder="Date Of Birth" id="dob" name="dob" required/>
</div>
</div>
<div class="form-row">
<div class="col">
<button class="btn btn-primary" action="submit" name="submit" style="width:100px;margin-top:20px" >Submit</button>
</div>
</div>
</div>
</form>
</body>
</html>