Advertisement
Guest User

Untitled

a guest
Sep 18th, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2. if (!empty($_POST['email']) & !empty($_POST['password'])) {
  3. $xml = simplexml_load_file("db/db.xml");
  4. $postuser = $_POST['email'];
  5. $postpassword = $_POST['password'];
  6. foreach ($xml->user as $id) {
  7. $email[] = $id->email;$pass[] = $id->pass;
  8. $fname[] = $id->fname;$lname[] = $id->lname;
  9. $zip[] = $id->zip;$address[] = $id->address;
  10. $hometype[] = $id->hometype;$bedrooms[] = $id->bedrooms;
  11. $bathrooms[] = $id->bathrooms;$livingrooms[] = $id->livingrooms;
  12. $kitchens[] = $id->kitchens;$sqfoot[] = $id->sqfoot;
  13. }
  14. if (in_array($postuser, $email)) {
  15. $key = array_search($postuser, $email);
  16. if ($postpassword == $pass[$key]) {
  17. echo "password correct";
  18. }
  19. else { echo "wrong password"; }
  20. }
  21. else { echo "error, no user found"; }
  22. }
  23. else { echo "please log in"; }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement