Guest User

Untitled

a guest
Feb 18th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. //anzeigen
  5.  
  6. $dbc = mysqli_connect(
  7. "localhost",
  8. "root",
  9. "",
  10. "adressbuch"
  11. )
  12. or die("MYSQL: Conncection error \n" .mysqli_connect_error());
  13.  
  14. $username = $_POST ["user"];
  15. $password = $_POST ["pw"];
  16.  
  17. $sql = "SELECT `Benutzername` FROM `accounts` WHERE `Benutzername` = '".$username."' AND `Passwort` = '".$password."'";
  18. $result = mysqli_query($dbc, $sql);
  19.  
  20. if(mysqli_num_rows($result) > 0) {
  21.  
  22.  
  23. $_SESSION['session'] = true;
  24. header("Location: test.php");
  25.  
  26. }
  27.  
  28. ?>
Add Comment
Please, Sign In to add comment