-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect.php
More file actions
36 lines (31 loc) · 945 Bytes
/
select.php
File metadata and controls
36 lines (31 loc) · 945 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<?php
$link = mysqli_connect("localhost", "root", "", "tap");
// Check connection
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
$select = mysqli_real_escape_string($link, $_REQUEST['select']);
$school1 = mysqli_real_escape_string($link, $_REQUEST['school1']);
$sr = $_POST['add'];
echo $sr;
$sql = "UPDATE applicants SET selected = '$select', school = '$school1' WHERE sr = '$sr' ";
if (mysqli_query($link, $sql) === TRUE) {
echo "<script type='text/javascript'>
window.location = 'selected_applicants.php'
</script>";
} else {
echo "Error updating record: " . mysqli_error($link);
}
mysqli_close($link);
?>
</body>
</html>