Advertisement
Guest User

Untitled

a guest
Jan 1st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. RewriteEngine on
  2. Redirect /Downloads/file1.rar /loginAuth1.php
  3. Redirect /Downloads/file2.rar /loginAuth2.php
  4.  
  5. if(isset($_POST['username']) && isset($_POST['password'])){
  6.  
  7. $username = mysqli_real_escape_string($con, $_POST['username']);
  8. $password = mysqli_real_escape_string($con, md5($_POST['password']));
  9.  
  10. $result = mysqli_query($con, "SELECT * FROM `users` WHERE `username` = '$username'") or die(mysqli_error($con));
  11. if(mysqli_num_rows($result) < 1){
  12. header("Location: loginAuth1.php?error=incorrect-password");
  13. }
  14. while($row = mysqli_fetch_array($result)){
  15. if($password != $row['password']){
  16. header("Location: loginAuth1.php?error=incorrect-password");
  17. }elseif($row['status'] == "0"){
  18. header("Location: loginAuth1.php?error=banned");
  19. }else{
  20. $_SESSION['id'] = $row['id'];
  21. $_SESSION['username'] = $username;
  22. $_SESSION['email'] = $row['email'];
  23. $_SESSION['rank'] = $row['rank'];
  24. header("Location: Downloadsfile1.rar");
  25. }
  26. }
  27. }
  28.  
  29. if(isset($_POST['username']) && isset($_POST['password'])){
  30.  
  31. $username = mysqli_real_escape_string($con, $_POST['username']);
  32. $password = mysqli_real_escape_string($con, md5($_POST['password']));
  33.  
  34. $result = mysqli_query($con, "SELECT * FROM `users` WHERE `username` = '$username'") or die(mysqli_error($con));
  35. if(mysqli_num_rows($result) < 1){
  36. header("Location: loginAuth2.php?error=incorrect-password");
  37. }
  38. while($row = mysqli_fetch_array($result)){
  39. if($password != $row['password']){
  40. header("Location: loginAuth2.php?error=incorrect-password");
  41. }elseif($row['status'] == "0"){
  42. header("Location: loginAuth2.php?error=banned");
  43. }else{
  44. $_SESSION['id'] = $row['id'];
  45. $_SESSION['username'] = $username;
  46. $_SESSION['email'] = $row['email'];
  47. $_SESSION['rank'] = $row['rank'];
  48. header("Location: Downloadsfile2.rar");
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement