Guest User

Untitled

a guest
Feb 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <?php
  2.  
  3. //ob
  4. ob_start();
  5.  
  6. //session
  7. session_start();
  8.  
  9. //connect
  10. $error = 'Could not connect to Database';
  11. mysql_connect('sql301.byethost33.com','b33_8897702','uwnwa101') or die($error);
  12. mysql_select_db('b33_8897702_serverscene') or die($error);
  13.  
  14. //include functions
  15. require '../includes/functions.php';
  16.  
  17. if ($_POST['login'])
  18.  
  19. {
  20.  
  21. //get form data
  22. $username = addslashes(strip_tags(strtolower($_POST['username'])));
  23. $password = addslashes(strip_tags($_POST['password']));
  24.  
  25. if (!$username || !$password)
  26. echo "Please enter a username and password<p />";
  27. else
  28. {
  29. //find username, to check if it exists
  30. $find = mysql_query ("SELECT * FROM serverscene_users WHERE username_clean='$username'");
  31. if (mysql_num_rows($find)==0)
  32. echo "Username not found";
  33. else
  34. {
  35. while ($find_row = mysql_fetch_assoc($find))
  36. {
  37. //grab password hash for user
  38. $password_hash = $find_row['user_password'];
  39. }
  40.  
  41. echo $password_hash;
  42.  
  43. }
  44.  
  45. }
  46.  
  47. ?>
  48.  
  49. <form action="login.php" method="POST">
  50. Username:<br />
  51. <input type="text" name="username"><p />
  52. Password:<br />
  53. <input type="password" name="password"><p />
  54. <input type="submit" name="login" value="Login"><p />
  55.  
  56. </form>
Add Comment
Please, Sign In to add comment