-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·51 lines (48 loc) · 1.2 KB
/
Copy pathindex.php
File metadata and controls
executable file
·51 lines (48 loc) · 1.2 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
<?php
$name = filter_input(
INPUT_POST,
'name',
FILTER_CALLBACK,
[
'options' => function ($value) {
$value = strlen($value) > 2 && strlen($value) < 21 ? $value : '';
return $value;
}
]
);
$lastName = filter_input(
INPUT_POST,
'lastName',
FILTER_CALLBACK,
[
'options' => function ($value) {
$value = strlen($value) > 2 && strlen($value) < 21 ? $value : '';
return $value;
}
]
);
$email = filter_input(
INPUT_POST,
'email',
FILTER_VALIDATE_EMAIL
);
if ($name) {
if ($lastName) {
if ($email) {
require_once 'write.php';
$write = new Write;
$result = $write->writeInFile($name, $lastName, $email);
if ($result) {
echo "Вы зарегистрировались!";
} else {
echo "Вы уже зарегистрированы!";
}
} else {
echo "не правильный email";
}
} else {
echo "не правильная валидация фамилии";
}
} else {
echo "не правильная валидация имени";
}