Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="ru">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
- <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
- <link rel="stylesheet" type="text/css" href="css/slick-theme.css"/>
- <link rel="stylesheet" type="text/css" href="css/slick.css"/>
- <link rel="stylesheet" href="css/style.css">
- <title>InstaTOP - Продвижение в инстаграмме</title>
- </head>
- <body>
- <?php
- require "scripts/db.php";
- $data = $_POST;
- if ( isset($data['do_signup']) ) {
- $errors = array();
- if ( trim($data['email']) == '' ) {
- $errors[] = 'Введите почту!';
- }
- if ( $data['firstname'] == '' ) {
- $errors[] = 'Введите имя!';
- }
- if ( $data['lastname'] == '' ) {
- $errors[] = 'Введите фамилию!';
- }
- if ( trim($data['login']) == '' ) {
- $errors[] = 'Введите логин!';
- }
- if ( $data['password'] == '' ) {
- $errors[] = 'Введите пароль!';
- }
- if ( $data['password'] != $data['repeatpassword']) {
- $errors[] = 'Пароли не совпадают!';
- }
- if ( empty($errors) ) {
- $user = R::dispense('users');
- $user->email = $data['email'];
- $user->firstname = $data['firstname'];
- $user->lastname = $data['lastname'];
- $user->login = $data['login'];
- $user->phone = $data['phone'];
- $user->password = $data['password'];
- R::store($user);
- echo '<div class="register_error">Успешная регистрация</div>';
- } else {
- echo '<div class="register_error">'.array_shift($errors).'</div>';
- }
- }
- ?>
- <div class="container">
- <div class="row">
- <div class="authorize text-center">
- <h1 class="login">InstaTOP</h1>
- <h4 class="login">Продвижение в инстаграмме</h4>
- <h4 class="login">Регистрация</h4>
- <hr>
- <form action="register.php" method="POST">
- <input type="text" class="input" name="email" placeholder="E-Mail" value="<?php echo @$data['email']; ?>">
- <input type="text" class="input" name="firstname" placeholder="Имя" value="<?php echo @$data['firstname']; ?>">
- <input type="text" class="input" name="lastname" placeholder="Фамилия" value="<?php echo @$data['lastname']; ?>">
- <input type="text" class="input" name="login" placeholder="Логин" value="<?php echo @$data['login']; ?>">
- <input type="text" class="input" name="phone" placeholder="Телефон" value="<?php echo @$data['phone']; ?>">
- <input type="password" class="input" name="password" placeholder="Пароль">
- <input type="password" class="input" name="repeatpassword" placeholder="Повторите пароль">
- <hr>
- <button class="login" name="do_signup" type="submit">Регистрация</button><br><br>
- <a class="register" href="login.php">Уже зарегистрированы? - Авторизоваться.</a>
- </form>
- </div>
- </div>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment