Guest User

Untitled

a guest
Apr 26th, 2018
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. <?php
  2. //$username='';
  3. //$password1='';
  4. $con=mysqli_connect("192.168.100.75:3307","dac22","welcome","dac22");
  5. if(isset($_REQUEST['submit'])){
  6. $username=$_REQUEST['username'];
  7. $password1=$_REQUEST['password'];
  8. $query="select * from user where name='$username' and password='$password1'";
  9. $run=mysqli_query($con,$query);
  10.  
  11.  
  12. //if(mysqli_num_rows($run)>0)
  13. //{
  14. while($row=mysqli_fetch_array($run))
  15. {
  16. $uname=$row["name"];
  17. $password=$row["password"];
  18. $type=$row["type"];
  19. $activated=$row['activated'];
  20. }
  21. // if($username==$uname && $password1==$password)
  22. // {
  23. session_start();
  24. //header("Login/LoginSession.php");
  25. if($activated==1)
  26. {
  27. $_SESSION['type']=$type;
  28. switch ($type)
  29. {
  30. case 1:
  31. header('Location: ../Administrator/home.php');
  32. break;
  33.  
  34. case 4:
  35. $_SESSION['name']=$uname;
  36. header('Location: ../Faculty/home.php');
  37. break;
  38. case 8:
  39. $_SESSION['name']=$uname;
  40. //echo "locatin: student";
  41. header('Location:../Student/home.php');
  42. break;
  43. case 16:
  44. header('Location: ../Sales/home.php');
  45. break;
  46. }
  47. }
  48.  
  49. }
  50. //}
  51. ?>
Add Comment
Please, Sign In to add comment