-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinjector.php
More file actions
33 lines (26 loc) · 846 Bytes
/
Copy pathinjector.php
File metadata and controls
33 lines (26 loc) · 846 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
<?php
if(isset($_GET["uid"])) {
$uid = $_GET["uid"]; // get uid value from HTTP GET
$nama = $_GET["nama"]; // get nama value from HTTP GET
$points = $_GET["points"]; // get points value from HTTP GET
$servername = "localhost";
$username = "Arduino";
$password = "ArduinoPass";
$dbname = "db_arduino";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO db_rvm (uid_value, name, points_value) VALUES ($uid, '$name', $points)";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . " => " . $conn->error;
}
$conn->close();
} else {
echo "Data is not set";
}
?>