class ajax public function signup email Flight request data- email pas

 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
class ajax {
public function signup () {
$email = Flight::request()->data->email;
$password = Flight::request()->data->password;
$confirm = Flight::request()->data->confirm;
$error = null;
if (empty($email))
$error .= '<p>Email адресс не заполнен!</p>';
if (empty($password))
$error .= '<p>Пароль не заполнен!</p>';
if (empty($confirm))
$error .= '<p>Повтор пароля не заполнен!</p>';
elseif ($confirm != $password)
$error .= '<p>Пароли не совпадают!</p>';
if ($error) {
exit(Flight::json(array('error' => $error)));
}
exit(Flight::json(array('error' => $error)));
}
}