Guest User

Untitled

a guest
Nov 14th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. <?php
  2.  
  3. //ob
  4. ob_start();
  5.  
  6. //session
  7. session_start();
  8. //database shit
  9. $con=mysqli_connect("localhost","hardwell","aiw3o8A06uIZVGVd","forum_db");
  10. // Check connection
  11. if (mysqli_connect_errno())
  12. {
  13. echo "Failed to connect to MySQL: " . mysqli_connect_error();
  14. }
  15.  
  16. // ...some PHP code for database "my_db"...
  17.  
  18. // Change database to "test"
  19. mysqli_select_db($con,"forum_db");
  20.  
  21. // ...some PHP code for database "test"...
  22.  
  23. mysqli_close($con);
  24. //Connection ENd here
  25. //set call function.php
  26. require 'forum/includes/functions.php';
  27.  
  28. //Main PHP STAT HERE
  29. if (isset($_POST['login']))
  30. {
  31. //form valus
  32. $username =addslashes (strip_tags(strtolower($_POST['usernamed'])));
  33. $password =addslashes (strip_tags($_POST['passwordd']));
  34.  
  35. if (!$username|| !$password)
  36. echo "Passowrd plz";
  37. else
  38. {
  39. //Find user
  40. $find = mysql_query($con,"SELECT * FROM phpbb_users WHERE username_clean='$username'");
  41.  
  42. if(mysql_num_rows($find)==0)
  43. echo "username fail";
  44. else{
  45. while($find_row = mysql_fetch_assoc($find))
  46. {
  47. //password
  48. $password_hash = $find_row['user_password'];
  49. }
  50.  
  51. echo $password_hash;
  52.  
  53. }
  54. }
  55.  
  56.  
  57.  
  58. }
  59. ?>
  60. <form action="login.php" method="POST">
  61. username: <br />
  62. <input type="text" name="usernamed"> <p/>
  63. Passowrd : <br />
  64. <input type="password" name="passwordd"><p/>
  65. <input type="submit" name="login" value="log in">
  66. </form>
Add Comment
Please, Sign In to add comment