Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once "funcs/functions.php";
- $userdata = get_user_data();
- foreach ($userdata as $d) {
- $name = $d["nome"];
- $id = $d["id"];
- $matricula = $d["matricula"];
- echo $name."<br>".$id."<br>".$matricula;
- }
- function get_user_data(){
- $user = $_SESSION["Login"];
- $pass = $_SESSION["Password"];
- $pdo = cnx();
- $select = $pdo->query("select * from matricula where username = '$user'");
- $select->execute();
- $rowCount = $select->rowCount();
- if ($rowCount == 0):
- header("Location:index.php?no=1");
- else:
- foreach ($select as $a):
- $password = $a["password"];
- endforeach;
- if($pass == $password){
- return $select;
- } else {
- header("Location:index.php?no=1");
- }
- endif;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement