forked from HackedK/ProjectPUBG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput.html
68 lines (65 loc) · 1.69 KB
/
input.html
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
<!DOCTYPE html>
<html>
<head>
<script src = "http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type = "text/javascript" src = "pubg.js"></script>
<style>
div.input{
position: absolute;
top: 300px;
left: 550px;
width: 300px;
height: 300px;
font-size: : 500px;
}
body {
background-size: cover;
}
</style>
<title>Project PUBG</title>
</head>
<body background= "/CSS/pubg.jpg">
<div class = "input">
<form>
<input type = "text" id="username" name = "username" placeholder = "Enter your PUBG name" style = "height: 50px" ></input>
<button id = "submit" style = "height: 50px">search</button>
</form>
</div>
<script>
// ajax call when search button is clicked
$("#submit").click(function(){
username = $("#username").val();
// send input username to pubg.js
$.ajax({
type: "POST",
url: 'http://127.0.0.1:9091',
data: '{"nickname": ' + "'" + username + "'" + ' }'
})
// send input username to select.php
$.ajax({
type: "POST",
url: "select.php",
data: '{"nickname": ' + "'" + username + "'" + ' }',
success: display(response, status)
})
console.log(display());
});
// response is object that contains query result
// not using status
function display(response, status){
var url = "";
var index = 1;
$.each(response, function(key, value){
url += key + "=" + value;
index++;
if(index != response.length){
url += "&";
}
})
console.log(url);
window.open('test2PHPstyle.php?' + url);
}
//in display.php use $_GET to get data from here
</script>
</body>
</html>