Advertisement
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, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
- <link rel="stylesheet" href="style.css">
- <title>Doc</title>
- </head>
- <body>
- <?php
- require('connect.php');
- if(isset($_POST['username']) && isset($_POST['password'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $query = "INSERT INTO users (login, pass) VALUES ('$username', '$password')";
- $result = $connection->query($query);
- if($result){
- $smsg = "Регистрация прошла успешна";
- }
- else $fsmsg = "Ошибка";
- }
- ?>
- <div class="container">
- <form class="form-signin" method="POST">
- <h2>Регистрация</h2>
- <?php if(isset($smsg)){ ?><div class="alert alert-succes" role="alert"> <?php echo $smsg; ?></div><?php } ?>
- <?php if(isset($fsmsg)){ ?><div class="alert alert-danger" role="alert"> <?php echo $fsmsg; ?></div><?php } ?>
- <?php print_r(error_get_last()); ?>
- <input type="text" name="username" class="form-control" placeholder="username">
- <input type="password" name="password" class="form-control" placeholder="Password">
- <button class="btn btn-lg btn-primary btn-block" type="submit">Register</button>
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement