Password access validation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WarrenWalker
    New Member
    • Jul 2014
    • 2

    Password access validation

    This is the code in the html
    Code:
    <center>
      <form action='php/login.php' method='post' name='login'>
        <h1>Login</h1>
        <input type='email' name='user_email'>
        <input type='password' name='user_password'>
        <input type='submit' name='submit' value='Login'>
      </form>
    </center>
    This is the PHP to validate email and password
    Code:
    <?php
    
    $user_page = "http://www.mysite.com/index.php?page=error404";
    
    if ($_POST['wwalker@mysite.com'] != $user_email || $_POST['password'] != $user_password) { 
    	$user_page == "http://www.mysite.com/index.php?page=loggedin";
    }
    
    header('Location: '.$user_page);
    exit();
    
    ?>
    What am i doing wrong, because it doesn't take the email and password across?
    Is the validation code right?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    None of your variables are populated. Plus one of your post indexes doesn't exist.

    Comment

    Working...