Advertisement
Guest User

Untitled

a guest
Mar 27th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "id8831321_admin";
  4. $password = "Welkom01";
  5. $dbname = "id8831321_port";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9. // Check connection
  10. if ($conn->connect_error) {
  11. die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14. if($_SERVER["REQUEST_METHOD"] == "POST") {
  15. // username and password sent from form
  16.  
  17. $uid = mysqli_real_escape_string($conn,$_POST['uname']);
  18. $pwd = mysqli_real_escape_string($conn,$_POST['psw']);
  19. }
  20. $sql = "SELECT * FROM gebruikers WHERE email='$uid' AND wachtwoord='$pwd'";
  21. $result = mysqli_query($conn, $sql);
  22.  
  23. if ($row = mysqli_fetch_assoc($result)) {
  24. header("Location: index2.html");
  25. } else {
  26. echo "Your username or password is incorrect!";
  27. }
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement