how to display user data on a bootstrap card after login is validated

-1

Hello, I'm developing a real estate site where I want to store user information after login, I'm trying to use session, but I'm not having success in storing my user information in the variables, on page after login where I was to aparecero name is white, but no error appears. Does anyone know a simple and functional way to store show the information of the logged in user. grateful.

    
asked by anonymous 23.11.2018 / 17:28

1 answer

0

Difficult to give a solution without seeing part of the code, but I believe you can do it this way:

<?php
if(!isset($_SESSION))
{
    session_start();
}
$_SESSION['login'] = $_POST['login']; 
$_SESSION['senha'] = $_POST['senha']; 
//  restante do código CRUD e etc
?>

ai to access the values saved in the session just log in to all the pages you will use as shown below, but it is good to point out that this is not the best way to traffic user data, it would be better for you alone save the id of it for example and then when it is necessary to batch the data in the database.

if(!isset($_SESSION))
    {
        session_start();
    }
    
23.11.2018 / 18:05