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

Asked

Viewed 63 times

-1

hello I am developing a real estate website where I want to store user information after login, I am trying to use Yes however I am not having success in storing my user information in the variables, on the page after the login where it was supposed to appear the name is empty, but no error appears. Someone knows a simple and functional way to store the user login information. grateful.

  • Dude include at least what you already have of code. how can we tell you where you went wrong without seeing what you did? Edit there with what you have so far

1 answer

0

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

<?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 Sesssion just log in to all the pages you will use as shown below, but it is worth noting that is not this is not the best way to traffic user data, it would be better if you just save his id for example and then when it is necessary to bucar the data in the database.

if(!isset($_SESSION))
    {
        session_start();
    }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.