Advertisement
Guest User

Untitled

a guest
Aug 14th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <?php
  2. include 'configMick.php';
  3. session_start();
  4. $formUsername=$HTTP_POST_VARS["username"];
  5. $formPassword=$HTTP_POST_VARS["password"];
  6. $formIdentity=$HTTP_POST_VARS["identities"];
  7. $query="select * from $formIdentity where username='$formUsername'";
  8. $result=mysql_query($query);
  9. $row=mysql_fetch_array($result);
  10.  
  11. if ($row)
  12. {
  13.  
  14. if ($row["userpass"]==$formPassword)
  15. {
  16. session_register("password");
  17. $_SESSION["password"]=$formPassword;
  18.  
  19. session_register("username");
  20. $_SESSION["username"]=$formUsername;
  21.  
  22. session_register("identities");
  23. $_SESSION["identities"]=$formIdentity;
  24. if($formIdentity=="Judge")
  25. {
  26. session_register("judgeloggedin");
  27. $_SESSION["judgeloggedin"]="true";
  28. echo "<script>location.href='judges_login.php';</script>";//
  29.  
  30. }
  31. else if($formIdentity=="Artist")
  32. {
  33. session_register("artistloggedin");
  34. $_SESSION["artistloggedin"]="true";
  35. echo "<script>location.href='Artist.php';</script>";
  36. }
  37. exit;
  38. }
  39. else
  40. {
  41. echo '<script>alert("Else1- your password is wrong"); </script>';
  42. $response.="Your password is wrong.";
  43. echo "<script>location.href='Backstage-pass.php';</script>";
  44. }
  45. }
  46. else
  47. {
  48. echo '<script>alert("Else2- Your username and password are wrong: ' . $formUsername . ' ' . $formPassword . ' ' . $formIdentity . '");</script>';
  49. $response.="Your username and password are wrong.";
  50. echo "<script>location.href='Backstage-pass.php';</script>";
  51. // close mysql connection
  52. mysql_close();
  53. }
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement