Guest User

Untitled

a guest
Jan 13th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. if(isset($_POST['submit'])) {
  2.  
  3. $username = $_POST['username'];
  4. $password = $_POST['password'];
  5.  
  6.  
  7. $connection = mysqli_connect('localhost', 'root', 'root', 'loginapp');
  8.  
  9. if($connection) {
  10.  
  11. echo "We are connected";
  12.  
  13. } else {
  14. }
  15.  
  16. die("Database connection failed");
  17.  
  18. ?>
  19.  
  20.  
  21.  
  22.  
  23. <!DOCTYPE html>
  24. <html lang="en">
  25. <head>
  26. <meta charset="UTF-8">
  27. <title>Document</title>
  28. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
  29. </head>
  30. <body>
  31. <div class="container">
  32.  
  33. <div class="col-sm-6">
  34. <form action="login.php" method="post">
  35. <div class="form-group"></div>
  36. <label for="username">Username</label>
  37. <input type="text" name="username" class="form-control">
  38.  
  39.  
  40. <div class="form-group">
  41. <label for="password">Password</label>
  42. <input type="password" name="password" class="form-control">
  43.  
  44.  
  45. <input class="btn btn-primary" type="submit" name="submit" value="Submit">
  46. </div>
  47. </form>
  48.  
  49. </div>
  50. </div>
  51. </body>
  52. </html>
Add Comment
Please, Sign In to add comment