0

How can i redirect to admin and user page ?

<?php
session_start();

$con = mysql_connect("localhost","root","nano");
$selected = mysql_select_db("airline");


$username=$_POST['uname'];
$password=$_POST['ptxt'];

$username = stripslashes($username);
$password = stripslashes($password);



$query = "SELECT * FROM user WHERE name='$username' AND password='$password'";
$result = mysql_query($query);
$count = mysql_num_rows($result);

if($count==1){
    $_SESSION['username']=$username;
    header("Location:login_success.php");
}else if{
    $_SESSION['username']=$username;
    header("Location:admin.php");
}else {
    header("Location:index.php")
}
?>
2
Contributors
1
Reply
11
Views
2 Years
Discussion Span
Last Post by broj1
0

The else if part of the code (line 23) should contain a condition.

The rest of the answer is waiting for you here (similar post you started earlier on).

Edited by broj1

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.