Advertisement
Guest User

Untitled

a guest
Aug 29th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. R::count( 'users', ' `name` = ? ', [ $_POST['name'] ] )
  2.  
  3. if ( trim($_POST['name']) == '' ) {
  4. echo "Введите ник!";
  5. } else if ( R::count( 'users', ' `name` = ? ', [ $_POST['name'] ] ) > 0) {
  6. echo "Имя занято!";
  7. } else if ( trim($_POST['email']) == '' ) {
  8. echo "Введите e-mail!";
  9. } else if ( trim($_POST['password']) == '' ) {
  10. echo "Введите пароль!";
  11. } else if ( $_POST['password'] !== $_POST['cpassword'] ) {
  12. echo "Пароли не совпадают!";
  13. } else {
  14. $user = R::dispense('users');
  15. $user->name = $_POST['name'];
  16. $user->email = $_POST['email'];
  17. $user->password = md5(md5($_POST['password']));
  18. $user->message = $_POST['message'];
  19. $user->date = date('d-m-Y, H:i');
  20. $complete = R::store( $user );
  21. echo $complete;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement