-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsendcordi.php
65 lines (52 loc) · 1.63 KB
/
sendcordi.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
56
57
58
59
60
61
62
63
64
65
<html>
<style>
body {
background-image: url("https://cdn0.tnwcdn.com/wp-content/blogs.dir/1/files/2018/03/screener_1521017380872-796x419.jpg");
background-repeat: no-repeat;
background-size: cover;
font-size: 4vh;
}
</style>
<head>
<title>TrackResponse</title>
<link href="https://fonts.googleapis.com/css?family=Space+Mono" rel="stylesheet">
</head>
<body topmargin="20%">
<div style="font-family: 'Space Mono', monospace; background-color:#666666; margin: auto;
width: 50%;
border: 3px solid BLACK;
padding: 10px;
border-radius:30px">
<?php
$lat=$_POST["cdlat"];
$lon=$_POST["cdlon"];
$servername = "localhost";
$username = "id11285787_meow";
$password = "abcdef";
$dbname="id11285787_meow";
$conn = new mysqli($servername, $username,$password, $dbname);
$query = "SELECT id FROM users";
$result = mysqli_query($conn, $query);
if (empty($result)) {
$query = "CREATE TABLE users (
id int(3) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
lat VARCHAR(100),
lon VARCHAR(100)
)";
$result = mysqli_query($conn, $query);
}
if ($conn->connect_error) {
die("cant access:" . $conn->connect_error);
}
$sql = "INSERT INTO users(lat,lon)
VALUES('$lat','$lon');";
if ($conn->query($sql) === true) {
echo "Hey! <br>" . "<center>You Have Been Tracked"."<br>"."Latitude ". $lat ."<br>". "Longitude " . $lon."</center>";
} else {
echo "Unable to Add values" . $sql . "<br>" . $conn->error;
}
?>
</div>
</body>
</html>