PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
else {
{
$sql_passe_check = "SELECT * FROM passe WHERE login='$login' and passe='$passe'";
$result_passe_check = mysql_query($sql_passe_check);
$passefound = mysql_num_rows($result_passe_check);
while ($row = mysql_fetch_array($result_passe_check))
{
$privilege=$row['privilege'];
}
//if checkbox not checked (=password)
if ($changecheck != "1")
{
if ($passefound < 1) {
echo $html1;
echo '<br /><div align="center"><br /><br /><img src="../media/sign_warning.jpg" width="70" height="70" border="0"><br /><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" size="3" color="white"><b>Password not correct !<br />Please go back and try again.</b><br /><br /><br /><br /><br /><a href="clients.html"><img src="../media/sign_back.jpg" width="40" height="40" border="0"></a><br /><br /><br /><br /><br /><br /><br /><br /><br /><div>';
echo $html2;
exit;
}
else {
//echo $privilege;
//exit;
if ($privilege = 1){
header("Location: norestric1.php");
}
if ($privilege = 2){
header("Location: norestric2.php");
}
if ($privilege = 3){
header("Location: norestric3.php");
}
exit;
}
}
?>
I know that $privilege is properly extracted from the DB because i can echo it.
But with the "if" and "header" conditions, the file redirects always on norestric3.php whatever the value of $privilege is.