I have 2 problems with this code first is that i only want the error code to display if the submit button has been selected and the username and password are incorrect. 2nd is that i am not sure where the redirect code should be placed in this code. Here is what i have so far
<html>
<head>
</head>
<body>
<?php
$user=$_POST['user'];
$pass=$_POST['pass'];
// start authenticate username and password
if (($user=="") && ($pass=="")) echo " Access Granted !" ;
else echo " Access Denied!";
?>
<form action='login.php' method='post'>
<p> Username: <input type='text' name='user'> </p>
<p>Password: <input type='password' name='pass'> </p>
<input type='submit' value='Login'>
</form>
</body>
</html>
header( 'Location: includes/inc_admin.php' )