Guest User

Untitled

a guest
Apr 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <form id='login' action='loginconfirm.php' method='post'>
  2. <fieldset >
  3. <label style="font-family: gothamlight; color: white; font-size: 1em;"
  4. class="loginform" for='username' >User:</label>
  5. <input class="loginform" type='text' name='username' maxlength="50" />
  6. <label style="font-family: gothamlight; color: white; font-size: 1em;"
  7. class="loginform" for='password' >Passwort:</label>
  8. <input class="loginform" type='password' name='password' maxlength="50"
  9. />
  10. <input type='submit' name='Submit' value='Login' />
  11. </fieldset>
  12. </form>
  13.  
  14. <?php
  15. $username = mysqli_real_escape_string($_POST['username']);
  16. $password = mysqli_real_escape_string($_POST['password']);
  17. require 'datenbank.php';
  18. $q = "SELECT * FROM users WHERE username = '$username'";
  19. $result = $mysqli->query($q) or die(mysqli_error());
  20. if (mysqli_num_rows($result) == 1) {
  21. setcookie('authorized', 1, 0);
  22. header("Location: http://www.google.de");
  23. }
  24. else {
  25. header("Location: admin.php");
  26. }
  27. ?>
Add Comment
Please, Sign In to add comment