-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhell.php
More file actions
52 lines (52 loc) · 1.58 KB
/
Copy pathhell.php
File metadata and controls
52 lines (52 loc) · 1.58 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.result {
border: solid 1px black;
width: 100vw;
height: 100vh;
}
table {
border: solid 2px black;
text-align: center;
width : 50px;
height: 50px;
}
th, td {
border: 2px solid black;
border-radius: 5px;
color: black;
}
</style>
<title>Document</title>
</head>
<body>
<button type="button" value="button">Query</button>
<div class="result" id="result">
</div>
<script>
var rc = document.getElementById("result");
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "abcd.php", true);
xmlhttp.send();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var js = JSON.parse(this.responseText);
console.log(js);
var s = "<table><tr><th> ID </th><th> Password </th><th> Dropout Rate </th></tr>";
for (var a = 0; a < js.length; a++) {
var id = js[a].school_ID;
var pw = js[a].pw;
var doRate = 100*(js[a].DS/js[a].TS);
s += "<tr><td> " + id + " </td><td> " + pw + " </td><td> " + doRate + " </td></tr>";
}
s += "</table>";
rc.innerHTML = s;
}
};
</script>
</body>
</html>