By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,313 Members | 2,798 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,313 IT Pros & Developers. It's quick & easy.

Password access validation

P: 2
This is the code in the html
Expand|Select|Wrap|Line Numbers
  1. <center>
  2.   <form action='php/login.php' method='post' name='login'>
  3.     <h1>Login</h1>
  4.     <input type='email' name='user_email'>
  5.     <input type='password' name='user_password'>
  6.     <input type='submit' name='submit' value='Login'>
  7.   </form>
  8. </center>
  9.  
This is the PHP to validate email and password
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $user_page = "http://www.mysite.com/index.php?page=error404";
  4.  
  5. if ($_POST['wwalker@mysite.com'] != $user_email || $_POST['password'] != $user_password) { 
  6.     $user_page == "http://www.mysite.com/index.php?page=loggedin";
  7. }
  8.  
  9. header('Location: '.$user_page);
  10. exit();
  11.  
  12. ?>
  13.  
What am i doing wrong, because it doesn't take the email and password across?
Is the validation code right?
Jul 21 '14 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,359
None of your variables are populated. Plus one of your post indexes doesn't exist.
Jul 21 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.