WORLDOFAJ

Untitled

Oct 31st, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <?php
  2. // Start the session
  3. session_start();
  4.  
  5.  
  6. include '../config/config.php';
  7. include '../config/connect.php';
  8.  
  9. $UName = ($_POST["username"]);
  10. $PW = ($_POST["password"]);
  11. $PassWord=0;
  12. $UserName=0;
  13. $quer= mysql_query("SELECT * FROM user where username='$UName' AND password='$PW'");
  14. while($ss = mysql_fetch_array($quer))
  15. {
  16. $UserName=$ss['username'];
  17. $PassWord=$ss['password'];
  18. $userid=$ss['userid'];
  19. $name=$ss['name'];
  20. $profilepicture=$ss['profilepicture'];
  21. $IDBranch=$ss['IDBranch'];
  22. $role=$ss['role'];
  23. }
  24.  
  25. if($PassWord!=$PW || $UserName!=$UName ){
  26. echo "<script>alert('Incorrect UserName or Password')</script>";
  27. echo "<script>location.href='../index.php'</script>";
  28. }
  29. else
  30. {
  31. $_SESSION["Id"]=$userid;
  32. $_SESSION["name"]=$name;
  33. $_SESSION["profilepicture"]=$profilepicture;
  34. $_SESSION["IDBranch"]=$IDBranch;
  35. $_SESSION["role"]=$role;
  36.  
  37. ?>
  38.  
  39. <!--<script>
  40. var person = prompt("Please enter your name", "Harry Potter");
  41. if (person != null) {
  42. document.getElementById("demo").innerHTML =
  43. "Hello " + person + "! How are you today?";
  44. }
  45. </script>-->
  46. <script>location.href='../summary.php'</script>"; -->
  47.  
  48. <?php } ?>
Add Comment
Please, Sign In to add comment