-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit.php
More file actions
78 lines (67 loc) · 1.32 KB
/
submit.php
File metadata and controls
78 lines (67 loc) · 1.32 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home 17 Pastushenko Gleb</title>
</head>
<body>
<div>Данные отправлены!</div>
<?php
error_reporting(0);
$form_data = array();
foreach ($_POST as $field => $data) {
$form_data += [$field => $_POST[$field]];
}
$dataBase = new mysqli("localhost", "root", "", "home_17");
$dataBase->set_charset("utf8");
mysqli_query($dataBase, "INSERT INTO form_data (
name,
surname,
sex,
age,
birth_date,
marital_status,
social_status,
home_address,
leisure_sleep,
leisure_walk,
leisure_fish,
leisure_play,
html_book,
books_number,
comments,
position_,
email,
equipment,
dinner,
million,
difficulty
) VALUES (
'$form_data[name]',
'$form_data[surname]',
'$form_data[sex]',
'$form_data[age]',
'$form_data[birth_date]',
'$form_data[marital_status]',
'$form_data[social_status]',
'$form_data[home_address]',
'$form_data[leisure_sleep]',
'$form_data[leisure_walk]',
'$form_data[leisure_fish]',
'$form_data[leisure_play]',
'$form_data[html_book]',
'$form_data[books_number]',
'$form_data[comments]',
'$form_data[position_]',
'$form_data[email]',
'$form_data[equipment]',
'$form_data[dinner]',
'$form_data[million]',
'$form_data[difficulty]'
)");
$dataBase->close();
foreach ($form_data as $field => $data) {
echo $field . " : " . $data . "</br>";
}
?>
</body>