Guest User

Untitled

a guest
Apr 25th, 2018
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. </form>
  2. <?php
  3. $con3=mysqli_connect("192.168.100.75:3307","dac8","welcome","gdac8") or die ("connection not successful");
  4. session_start();
  5. if(isset($_POST['uname']))
  6. {
  7. $uname=$_POST['uname'];
  8. $password=$_POST['pass'];
  9. $sql="select uid,username from userlogin where username='$uname'";
  10. $result=mysqli_query($con3,$sql);
  11. while($row=mysqli_fetch_array($result))
  12. {
  13. $user=$row['username'];
  14. $_SESSION["user"]=$user;
  15.  
  16. $ro=$row['uid'];
  17. $_SESSION['ro']=$ro;
  18. }
  19. $sql="select username,lastname from userlogin where username='$uname' and lastname='$password'";
  20. $run6=mysqli_query($con3,$sql);
  21. $num=mysqli_num_rows($run6);
  22.  
  23. if($num > 0)
  24. {
  25. if($ro =='1')
  26. {
  27. header('location:Administrator/home.php');
  28. }
  29. else if($ro =='4')
  30. {
  31. header('location:faculty/faculty.php');
  32.  
  33. }
  34. else if($ro =='8')
  35. {
  36. header('loactaion:student/home.php');
  37. }
  38. else {
  39. header('loactaion:sales/home.php');
  40. }
  41. }
  42. else {
  43. echo "invalid";
  44. }
Add Comment
Please, Sign In to add comment