-
Notifications
You must be signed in to change notification settings - Fork 0
/
adddata.php
65 lines (58 loc) · 1.55 KB
/
adddata.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
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<style>
table{
background-color:black;
color:white;
margin:5%;
text-align:center;
}
</style>
</head>
<body>
<script>
window.location.href="log in.html";
var form = document.getElementById("MyForm");
form.reset();
</script>
<?php
$db = mysqli_connect("localhost", "root", "");
mysqli_select_db($db,"attendees");
$today_date_Global;
$sql_today_date = "SELECT CURDATE() AS today_date";
$result_today_date = mysqli_query($db, $sql_today_date);
if ($result_today_date)
{
$row = mysqli_fetch_assoc($result_today_date);
$today_date = $row['today_date'];
$today_date_Global = $today_date;
}
else
{
echo "Error executing the query: " . mysqli_error($conn);
}
$name = $_POST['name'];
$age = $_POST['age'];
$nationality = $_POST['nat'];
$phone = $_POST['phone'];
$q2="INSERT INTO attendees.members(
Name,
Nationality,
Age,
Phone,
Date
)
VALUES (
'$name',
'$nationality',
'$age',
'$phone',
'$today_date_Global'
);";
mysqli_query($db,$q2);
mysqli_close($db);
?>
</body>
</html>