-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheditStudent.php
55 lines (45 loc) · 1.68 KB
/
editStudent.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
<?php
include "config.php";
$id = $_GET['id'];
$sql = "SELECT * FROM student WHERE studentID = '$id'";
if($result = $conn->query($sql))
{
$row = $result->fetch_assoc();
$id = $row['studentID'];
$name = $row['studentName'];
$age = $row['studentAge'];
$address = $row['studentAddress'];
$image = $row['imgLoc'];
}
else
{
echo "Fail";
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Edit Menu</title>
<link rel="stylesheet" href="styles/style.css">
</head>
<body>
<div class = "container">
<div class="buttons">
<button><a href="index.php">View</a></button>
</div>
<div class = "editdetails box">
<div class = "border">
<img src="<?php echo $image ?>" alt="" class = "editimage">
<form action="editStudentValidate.php?oldID=<?php echo $id?>" method = "POST" enctype = "multipart/form-data">
<p>Student ID : <input type="text" name = "id" value = "<?php echo $id ?>"></p><br>
<p>Student Name : <input type="text" name = "name" value = "<?php echo $name ?>"></p><br>
<p>Student Age : <input type="text" name = "age" value = "<?php echo $age ?>"></p><br>
<p>Student Address : <input type="text" name = "address" value = "<?php echo $address ?>"></p><br>
<p>Student Image : <input type="file" name = "image"></p><br>
<input type="submit" value = "Edit Details" class = "button">
</form>
</div>
</div>
</div>
</body>
</html>