Advertisement
Guest User

Untitled

a guest
Mar 16th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. while ($stmt->fetch()) {
  2. if ($teacherusername == $dbTeacherUsername && $teacherpassword == $dbTeacherPassword) {
  3. if ($dbActive == 1) {
  4. $loggedIn = true;
  5. } else if ($dbActive == 0) {
  6. $loggedIn = false;
  7. echo "You Must Activate Your Account from Email to Login";
  8. }
  9. }
  10. }
  11.  
  12. if ($loggedIn == false && $_POST) {
  13. echo "The Username or Password that you Entered is not Valid. Try Entering it Again";
  14. }
  15.  
  16. while($stmt->fetch()) {
  17. if ($teacherusername == $dbTeacherUsername && $teacherpassword == $dbTeacherPassword) {
  18. if ($dbActive == 1){
  19. $loggedIn = true;
  20. } else if ($dbActive == 0) {
  21.  
  22.  
  23. $loggedIn = false;
  24.  
  25. /****************************
  26. *
  27. * at this point, $loggedIn == false.
  28. *
  29. ****************************/
  30.  
  31.  
  32. echo "You Must Activate Your Account from Email to Login";
  33. }
  34. }
  35. }
  36.  
  37. /****************************
  38. *
  39. * at this point, $loggedIn == false.
  40. *
  41. * since $loggedIn == false and $_POST is truthy, your if statement will get entered.
  42. *
  43. ****************************/
  44.  
  45. if ($loggedIn == false && $_POST) {
  46. echo "The Username or Password that you Entered is not Valid. Try Entering it Again";
  47. }
  48.  
  49. $active = true;
  50.  
  51. .
  52. .
  53. .
  54.  
  55. if ($dbActive == 0) {
  56. $loggedIn = false;
  57. $active = false;
  58. echo "You Must Activate Your Account from Email to Login";
  59. }
  60.  
  61. .
  62. .
  63. .
  64.  
  65. if (!$loggedIn && $active && isset($_POST['formInputName']) {
  66. echo "The Username or Password that you Entered is not Valid. Try Entering it Again";
  67. }
  68.  
  69. while($stmt->fetch()) {
  70.  
  71. if ($stmt->fetch()) {
  72. if ($row->$dbActive) {
  73. # valid login
  74. } else {
  75. # needs activation
  76. }
  77. } else {
  78. # invalid login
  79. }
  80.  
  81. if ($dbActive == 1){
  82. $loggedIn = true;
  83. } else if ($dbActive == 0) {
  84. $loggedIn = false;
  85. echo "You Must Activate Your Account from Email to Login";
  86. }
  87.  
  88. if ($dbActive == 1){
  89. $loggedIn = true;
  90. } else{
  91. $loggedIn = false;
  92. echo "You Must Activate Your Account from Email to Login";
  93. }
  94.  
  95. if ($loggedIn == false && isset($_POST['somefield']) {
  96. echo "The Username or Passwor...";
  97. }
  98.  
  99. if ($loggedIn == false && !empty($_POST) && $dbActive != 0) {
  100. echo "The Username or Password that you Entered is not Valid. Try Entering it Again";
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement