I know there are similar threads, and I have looked at those threads, although none of them seem to work for me.
First off, I'd like to point out that this is a simple college assignment and is not an actual website, I am not worried about "security" or anything.
Secondly, my database is made of 'username' 'password' and 'admin', admin being 0 or 1.
What I need help with is to make the user redirect to 'hit-counter.php' if the admin value is 1, not 0.
Currently, they always go to 'index_loginsuccesful.php' no matter the admin value. (Or 'index_loginfailed.php' if the username/password is wrong)
Any thoughts?
<?php
$conn = mysql_connect ("localhost", "root","");
mysql_select_db("a_blub",$conn);
$result=mysql_query("SELECT password FROM user WHERE username = '$_POST[theusername]'",$conn);
$rows=mysql_fetch_array($result);
if($_POST['thepassword'] == $rows[0])
{
if ($_POST['admin'] == 1)
Header("location:hit-counter.php");
else
Header("location:index_loginsuccesful.php");
}
else
{
Header("location:index_loginfailed.php");
} ?>