View Single Post
  #1 (permalink)  
Old 10-14-03, 06:22 PM
mdhall's Avatar
mdhall mdhall is offline
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
If/else statement working...but not working

I'm using an if/else statement on a page named "results.php". When a user logs in from a form, they add a name and password, which are passed to "results.php" with no problem. When the name or password are incorrect, they get the "else" statement, showing that there is an error. This part is fine. However, when the name and password are correct, "results.php" displays as it should, but the "else" (error) statement is displaying at the top of the page. Heres what I'm using...

$student_number = $_POST['student_number'];
$unique_pass = $_POST['unique_pass'];

If($student_number=="student_number" && $unique_pass=="unique_pass")
{
print "Access Confirmed";<br>
}
Else
{ print "Access Denied<br>";
print "Your Student Number or Password is incorrect.<br>";
print "Please try again. Login Page";
}
?>
Any suggestions?
Reply With Quote