-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreg.php
More file actions
36 lines (29 loc) · 991 Bytes
/
reg.php
File metadata and controls
36 lines (29 loc) · 991 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
<?php
// Get the form data
$username = $_POST['username'];
$password = $_POST['password'];
$name = $_POST['name'];
$email = $_POST['email'];
$telegram = $_POST['telegram'];
$phone = $_POST['phone'];
$host = "localhost";
$dbusername = "";
$dbpassword = "";
$dbname = "";
// Create a connection to the database
$conn = mysqli_connect($host, $dbusername, $dbpassword, $dbname);
// Check if the connection was successful
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
// Insert the form data into the database
$sql = "INSERT INTO login (username, password, name, email, telegram, phone, gold, oil, farm, pharmaceuticals) VALUES ('$username', '$password', '$name', '$email', '$telegram', '$phone', '0', '0', '0', '0')";
if(mysqli_query($conn, $sql)){
header("Location: login.php");
exit();
} else{
echo "ERROR: Could not able to execute $sql. " . mysqli_error($conn);
}
// Close the database connection
mysqli_close($conn);
?>