Больше огрызков в корзину огрызков!

This commit is contained in:
lopar
2018-01-29 21:38:52 +02:00
parent 487440e9c1
commit 14ed72c021
12 changed files with 125 additions and 118 deletions
+18
View File
@@ -0,0 +1,18 @@
<?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);
?>