Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.10 KB | None | 0 0
  1. <?php session_start(); ?>
  2. <h1>Login</h1>
  3. <?php
  4. include("include/config.php");
  5. include("include/classes/login.php");
  6.  
  7. if(isset($_POST['login'])){
  8.  
  9. // Username
  10. $username = $_POST['username'];
  11. $username = strip_tags($username);
  12. $username = mysql_real_escape_string($username);
  13.  
  14. // Password
  15. $password = md5($_POST['password']);
  16. $password = strip_tags($password);
  17. $password = mysql_real_escape_string($password);
  18.  
  19. $check_login = mysql_query("SELECT * FROM users WHERE username = '$username' and password = '$password'") or die (mysql_error());
  20. $count = mysql_num_rows($check_login);
  21. $print = mysql_fetch_array($check_login);
  22. $check_login = new Check_login;
  23. $check_login->check_info($count, $print, $username);
  24. }
  25. ?>
  26. <form action="" method="post">
  27. <table width="auto">
  28. <tr>
  29. <td width="100px">Brugernavn</td>
  30. <td width="auto"><input name="username" type="text" /></td>
  31. </tr>
  32. <tr>
  33. <td width="100px">Kodeord</td>
  34. <td width="auto"><input name="password" type="password" /></td>
  35. </tr>
  36. <tr>
  37. <td width="100px"></td>
  38. <td width="auto"><input name="login" type="submit" value="Login" /></td>
  39. </tr>
  40. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement