-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeposituserdata.php
More file actions
36 lines (27 loc) · 890 Bytes
/
deposituserdata.php
File metadata and controls
36 lines (27 loc) · 890 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
$userFirstName = $_POST["fname"];
$userLastName = $_POST["lname"];
$userEmail = $_POST["email"];
$userPhone = $_POST["phone"];
$userCurrentLocationLat = $_POST["userCurrentLocationLat"];
$userCurrentLocationLong = $_POST["userCurrentLocationLong"];
//just some DB setup:
$servername = "localhost";
$username = "INSERT ME WHEN IN THE SERVER FILE";
$password = "INSERT ME WHEN IN THE SERVER FILE";
$dbname = "HawaiianWeather";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO Users (firstname, lastname, email)
VALUES ('John', 'Doe', 'john@example.com')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>