Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- </form>
- <?php
- $con3=mysqli_connect("192.168.100.75:3307","dac8","welcome","gdac8") or die ("connection not successful");
- session_start();
- if(isset($_POST['uname']))
- {
- $uname=$_POST['uname'];
- $password=$_POST['pass'];
- $sql="select uid,username from userlogin where username='$uname'";
- $result=mysqli_query($con3,$sql);
- while($row=mysqli_fetch_array($result))
- {
- $user=$row['username'];
- $_SESSION["user"]=$user;
- $ro=$row['uid'];
- $_SESSION['ro']=$ro;
- }
- $sql="select username,lastname from userlogin where username='$uname' and lastname='$password'";
- $run6=mysqli_query($con3,$sql);
- $num=mysqli_num_rows($run6);
- if($num > 0)
- {
- if($ro =='1')
- {
- header('location:Administrator/home.php');
- }
- else if($ro =='4')
- {
- header('location:faculty/faculty.php');
- }
- else if($ro =='8')
- {
- header('loactaion:student/home.php');
- }
- else {
- header('loactaion:sales/home.php');
- }
- }
- else {
- echo "invalid";
- }
Add Comment
Please, Sign In to add comment