register.php 585 B

123456789101112131415161718192021222324252627
  1. <?php
  2. require_once("user.php");
  3. $errors = array();
  4. $data = array();
  5. if (empty($_POST['registerPasswordValue']))
  6. $errors['registerPasswordValue'] = 'Password is required.';
  7. if ($_POST['registerPasswordValue'] != REGISTERPASSWORD)
  8. $errors['registerPasswordValue'] = 'Password does not match.';
  9. if ( ! empty($errors)) {
  10. $data['success'] = false;
  11. $data['errors'] = $errors;
  12. } else {
  13. $data['success'] = true;
  14. $data['message'] = 'Success!';
  15. }
  16. echo json_encode($data);
  17. ?>