Here's the code:
if ($result) {
if ( $num_rows > 0 && $type = 1 ) {
session_start();
$_SESSION['login'] = "1";
$_SESSION['loginname'] = $row['NOM'];
$_SESSION['centreAFB'] = $row['CENTRE'];
header ("Location: xxxxx.php");
}
else if ( $num_rows > 0 && $type = 2 ) {
session_start();
$_SESSION['login'] = "1";
$_SESSION['uname'] = $row['UN'];
$_SESSION['centreAFB']= $row['CENTRE'];
$_SESSION['utype'] = $row['ACCT_TYPE'];
$_SESSION['loginname'] = $row['NOM'];
header ("Location: xxxxx.php");
}
else if ( $num_rows > 0 && $type = 3 ) {
session_start();
$_SESSION['login'] = "1";
$_SESSION['loginname'] = "GUEST";
header ("Location: xxxxx.php");
}
else {
session_start();
$_SESSION['login'] = "";
header ("Location: xxxxx.php");
}
}
I've tried with $type = "1" or $type = '1' even removing the spaces between $type and = to no avail.
No matter what I do, it always uses the first condition.
I've verified that the proper value is stored in $type by echoing the value, even hard coding it in. No change....
I'm pretty sure the statement is correct...I'm stumped.
Help would be appreciated.