Hello. I have one problem with header function in my login script. The code is:
PHP Code:
$_SESSION["username"] = $dbusername; $username1 = $_SESSION['username']; $_SESSION["myusername"]=$dbusername; $sql1 = "SELECT admin FROM admin WHERE username=$username1"; $result1 = mysql_query($sql1) or die(mysql_error()); while ($row1 = mysql_fetch_array($result1)) { $admin = $row1['admin']; if ($admin != '1') { header("Location:../sales/"); } else { header("Location:index.php"); } }
When i log in, it opens checklogin.php file, but it don't redirect me to 'index.php'. But, when is $admin != '1', it redirects me to sales folder. I don't know what to do. Thanks.
|