<?php require "libs/rb.php"; $data = $_POST; if (isset($data['do_signup'])) { //регестрируем $errors = array(); if( trim($data['login']) == '' ) { $errors[] = 'Введите логин'; } if( trim($data['email']) == '' ) { $errors[] = 'Вы не ввели email'; } if( $data['password'] == '' ) { $errors[] = 'Вы не ввели пароль'; } if( $data['password_2'] == '' ) { $errors[] = 'Вы не ввели повторный пароль'; } if( $data['password_2'] != $data['password'] ) { $errors[] = 'Повторный пароль введён не верно'; } if( empty($errors) ) { //Можно регестрировать $user = R::dispense('users'); $user->login = $data['login']; $user->email = $data['email']; $user->password = $data['password']; R::store($user); echo '<div id="erorrs">Регистрация прошла успешно!</div><hr>'; } else { echo '<div id="erorrs">'.array_shift($errors).'</div><hr>'; } } ?> <style> .form_reg { width: 400px; height: 500px; background-color: #141414; margin: 10% auto; color: #fff; } button { color: #000; } </style> <form action="/signup.php" method="POST" class="form_reg"> Введите логин:<br> <input type="text" name="login" value="<?php echo @$data['login']; ?>"><br> Введите e-mail:<br> <input type="text" name="email" value="<?php echo @$data['email']; ?>"><br> Введите пароль:<br> <input type="password" name="password"><br> Введите Ваш пароль повторно:<br> <input type="password" name="password_2"><br> <button type="submit" name="do_signup">Зарегестрироваться</button> </form>
--
You received this message because you are subscribed to the Google Groups "redbeanphp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redbeanorm+unsubscribe@googlegroups.com.
To post to this group, send email to redbe...@googlegroups.com.
Visit this group at https://groups.google.com/group/redbeanorm.
For more options, visit https://groups.google.com/d/optout.