Advertisement
Guest User

Untitled

a guest
Aug 26th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?php
  2. require_once "funcs/functions.php";
  3. $userdata = get_user_data();
  4. foreach ($userdata as $d) {
  5. $name = $d["nome"];
  6. $id = $d["id"];
  7. $matricula = $d["matricula"];
  8.  
  9. echo $name."<br>".$id."<br>".$matricula;
  10. }
  11.  
  12. function get_user_data(){
  13. $user = $_SESSION["Login"];
  14. $pass = $_SESSION["Password"];
  15. $pdo = cnx();
  16. $select = $pdo->query("select * from matricula where username = '$user'");
  17. $select->execute();
  18. $rowCount = $select->rowCount();
  19. if ($rowCount == 0):
  20. header("Location:index.php?no=1");
  21. else:
  22. foreach ($select as $a):
  23. $password = $a["password"];
  24. endforeach;
  25. if($pass == $password){
  26. return $select;
  27. } else {
  28. header("Location:index.php?no=1");
  29. }
  30. endif;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement