Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="ru">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport"
  6. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7. <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">
  8. <link rel="stylesheet" href="style.css">
  9. <title>Doc</title>
  10. </head>
  11. <body>
  12. <?php
  13. require('connect.php');
  14.  
  15. if(isset($_POST['username']) && isset($_POST['password'])) {
  16. $username = $_POST['username'];
  17. $password = $_POST['password'];
  18.  
  19. $query = "INSERT_INTO users (login, password) VALUES ('$username', '$password')";
  20. $result = mysqli_query($connection, $query);
  21.  
  22. if($result){
  23. $smsg = "Регистрация прошла успешна";
  24. } else
  25. $fsmsg = "Ошибка";
  26. }
  27. }
  28. ?>
  29. <div class="container">
  30. <form class="form-signin" method="POST">
  31. <h2>Регистрация</h2>
  32. <?php if(isset($smsg)){ ?><div class="allert alert-succes" role="alert"> <?php echo $smsg; ?></div>} ?>
  33. <?php if(isset($fsmsg)){ ?><div class="allert alert-danger" role="alert"> <?php echo $smsg; ?></div>} ?>
  34. <input type="text" name="username" class="form-control" placeholder="username">
  35. <input type="password" name="password" class="form-control" placeholder="Password">
  36. <button class="btn btn-lg btn-primary btn-block" type="submit">Register</button>
  37. </form>
  38. </div>
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement