18 lines
481 B
PHP
18 lines
481 B
PHP
<?php
|
||
$errors = array();
|
||
$form_data = array();
|
||
|
||
if(empty($_POST['user'])) $errors['name'] = 'Вы кто?';
|
||
if(empty($_POST['hash'])) $errors['name'] = 'Где потеряли Hash?';
|
||
if(empty($_POST['sorted'])) $errors['name'] = 'Не понимаю кого искать ...';
|
||
|
||
if(!empty($errors)) {
|
||
$form_data['success'] = false;
|
||
$form_data['errors'] = $errors;
|
||
} else {
|
||
$form_data['success'] = true;
|
||
$form_data['posted'] = 'Great';
|
||
}
|
||
|
||
echo json_encode($form_data);
|
||
?>
|