Here what I have so far...
.HTML
<div id = "div-Login"> <form action="login.php" method="POST" target="loginerror"> <center><h2>Login Here</h2> <p> Username: <input type="text" name="username"><p> Password: <input type="password" name="password"><p> <input type="submit" name="submit" value="Login"> </center> <a href="register.html"><pre>need to register? Click Here!</pre></a> </form> <iframe name="loginerror" style="border: 0px; width: 200px; height: 100px; overflow: hidden;" src="login.php"></iframe> </div>
.PHP
if ($username==$dbusername&&$enc_password==$dbpassword) //if the username & encrpyted password matches the records in the database
{
if($admin !=0) //if the admin flag is true
{
$_SESSION['level']='ADMIN';//admin is logging in
header ("Location: admin.php"); //the user is an admin, direct to admin page
}
else
header ("Location: index.php"); //user is a customer, direct user to index page
$_SESSION['username']=$dbusername; //set the session name to the database record username.
}
else
//$nopass='TRUE';
//header ("location: loginU.php");
echo "Incorrect Password, Please try again"; // if incorrect password
}
else
echo ("That username doesn't exist"); // if user doesn't exist
}
else
echo ("Please enter a username and password"); //if either field is empty
Obviously, when the user sucessfully logs in the iframe is still trying to display the admin.php / index.php, i do not want this, but at the moment this is the only way I can get this simple message to display...
Any help will be welcome!

New Topic/Question
Reply



MultiQuote



|