Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <?php
  2. include './connect.php';
  3. if(($_SERVER["REQUEST_METHOD"]=="POST") && (!empty($_POST['username'])) && (!empty($_POST['password']))){
  4. $postedUsername = $_POST['username'];
  5. $postedPassword = $_POST['password'];
  6. $userDatabaseFind = $database->Bcard->find(array('username' => $postedUsername, 'password' => $postedPassword));
  7.  
  8. foreach ($userDatabaseFind as $useFind){
  9. $storedUsername = $useFind['username'];
  10. $storedPassword = $useFind['password'];
  11. }
  12.  
  13. if(($postedUsername == $storedUsername) && ($postedPassword == $storedPassword)){
  14. header('location:welcome.php');
  15. }
  16. else{
  17. echo 'Error';
  18. }
  19. } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement