Author Topic: need help with login/redirect page  (Read 122 times)

shelly

  • New Member
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
need help with login/redirect page
« on: February 03, 2012, 10:48:52 AM »
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

PHP Code: [Select]



<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' )