Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Homepage</title>
  5. <link rel="stylesheet" type="text/css" href="CSS/Pages/Home.css">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <script src="https://cdn.jsdelivr.net/npm/vue"></script>
  8. <p>
  9. <img class="Banner" src="IMAGES/Banner.png">
  10. </p>
  11.  
  12. </head>
  13. <body>
  14.  
  15. <?php
  16. $servername = "localhost";
  17. $username = "root";
  18. $password = "abc";
  19. $dbname = "users";
  20.  
  21.  
  22. $conn = new mysqli($servername, $username, $password, $dbname);
  23.  
  24. if ($conn->connect_error) {
  25. die("Connection failed: " . $conn->connect_error);
  26. }
  27.  
  28. if($_SERVER["REQUEST_METHOD"] === "POST") {
  29. $user = $_POST["User"];
  30. $pass = $_POST["Pass"];
  31. $sql = "INSERT INTO users (Username, Password) VALUES('".$user."', '".$pass."')";
  32.  
  33. if(mysqli_query($sql)) {
  34. echo "Done";
  35. } else {
  36. echo "Error";
  37. }
  38. }
  39.  
  40. ?>
  41.  
  42. <button onclick="document.getElementById('id01').style.display='block'" style="width:auto;">Register</button>
  43.  
  44. <div id="id01" class="modal">
  45.  
  46. <form class="modal-content animate">
  47. <div class="imgcontainer">
  48. <span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">&times;</span>
  49. <img src="IMAGES/Players/Lillard.png" alt="Avatar" class="avatar">
  50. </div>
  51.  
  52. <div class="container">
  53. <label><b>Username</b></label>
  54. <input type="text" placeholder="Enter Username" name="User" required>
  55.  
  56. <label><b>Password</b></label>
  57. <input type="password" placeholder="Enter Password" name="Pass" required>
  58.  
  59. <input type="submit" value="Register" name="Submit">
  60. </div>
  61.  
  62. <div class="container" style="background-color:#f1f1f1">
  63. <button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>
  64. </div>
  65. </form>
  66. </div>
  67.  
  68. <script>
  69. // Get the modal
  70. var modal = document.getElementById('id01');
  71.  
  72. // When the user clicks anywhere outside of the modal, close it
  73. window.onclick = function(event) {
  74. if (event.target == modal) {
  75. modal.style.display = "none";
  76. }
  77. }
  78. </script>
  79.  
  80. <nav>
  81. <ul>
  82. <li><a class="active" href="">Homepage</a></li>
  83. <li><a href="History.html"><span>History of Blazers</span></a></li>
  84. <li><a href="MeetTeam.html"><span>Meet the Team</span></a></li>
  85. <li><a href="Standings.html"><span>Standings</span></a></li>
  86. <li><a href="Fixtures.html"><span>Fixtures</span></a></li>
  87. <li><a href="ContactUs.html"><span>Contact Us</span></a></li>
  88. </ul>
  89. </nav>
  90.  
  91. <p>Welcome to the Unofficial Site of the Portland Trail Blazers. </p>
  92.  
  93. <div class="Twitter">
  94. <a class="twitter-timeline" data-width="400" data-height="500" href="https://twitter.com/trailblazers?ref_src=twsrc%5Etfw">Tweets by trailblazers</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
  95. </div>
  96. </body>
  97. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement