-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.php
More file actions
111 lines (103 loc) · 2.82 KB
/
Copy pathupdate.php
File metadata and controls
111 lines (103 loc) · 2.82 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
<?php
include("connection.php");
if(isset($_GET["id"])){
$id = $_GET ["id"];
$q = "SELECT * FROM student WHERE id ='$id' ";
$selectedStudent = $connection->query($q);
$row = $selectedStudent->fetch_assoc();
$result = "SELECT * FROM student WHERE id = '$id' ";
$selectname = $connection->query($result);
$row1 = $selectname->fetch_assoc();
};
if($_SERVER["REQUEST_METHOD"]=== "POST"){
$stName = $_POST["st_name"];
$stLastName = $_POST["st_lastName"];
$stTazkira = $_POST["tazkira_num"];
$imgUrl = $_POST["imgUrl"];
$class = $_POST["class"];
$result = $connection->query ("UPDATE student SET st_name= '$stName' ,
st_lastName='$stLastName',tazkira_num='$stTazkira',
imgUrl='$imgUrl'
where id ='$id', st_name='$stName' , st_lastName='$stLastName', tazkira_num='$stTazkira', imgUrl='$imgUrl' class='$class' ");
if($connection->query($result)===true){
header("location:searchStudent.php");
}
}
else{
header("location:searchStudent.php");
}
?>
<style>
.parent1{
background-color: rgb(4, 73, 116);
height: 100vh;
width: 98vw;
position: relative;
}
.parent{
border: 1px solid grey;
margin: auto;
width: 50%;
position:absolute;
top:15%;
left:25%;
align-items:center;
justify-content:center;
display:flex;
border-radius: 10px;
box-shadow: 3px 6px 10px grey;
background-color: white;
}
input{
padding: 10px;
margin: 10px ;
font-family: cursive;
border: none;
width:50%;
box-shadow: 1px 3px 4px grey;
border-radius: 5px;
margin-left: 20%;
}
input:focus{
outline: 0;
}
h1{
text-align: center;
font-family: cursive;
color:white;
margin-top:20px;
}
button{
background-color: rgb(4, 73, 116);
padding:12px;
border: none;
color: white;
border-radius: 4px;
display: block;
margin: 6px;
margin-left: 40%;
}
</style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class=" parent1">
<h1>UPDATE STUDENT</h1>
<div class="parent">
<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="Post">
<input type="text" name="st_name" placeholder="Name">
<input type="text" name="st_lastName" placeholder="LastName">
<input type="number" name="tazkira_num" placeholder="TazkiraNumber">
<input type="file" name="imgUrl" placeholder="ImgUrl">
<input type="text " name="class" placeholder="class">
<button>Update</button>
</form>
</div>
</div>
</body>
</html>