In order to display comments on a page, we first need to know what comments to show. PHP display username next to welcome once login. rev 2020.12.18.38240, Stack Overflow works best with JavaScript enabled, Where developers & technologists share private knowledge with coworkers, Programming & related technical career opportunities, Recruit tech talent & build your employer brand, Reach developers & technologists worldwide, After login store the id in session $_SESSION['id']=$current_user_id; and on account page fetch the account info using $_SESSION['id'] like select * from users where id=$_SESSION['id'], @JYoThI comment is the answer. When user logged in, it store the username in session $_SESSION[“username”], you can simply print this value on any PHP, it does not matter and check if its value is changing after login with different users. In this PHP file, the user data is retrieved from the database by using the logged-in session id. Users could also register for logging into the dashboard. The session variables are used to display logged in user information in PHP. How to make user authentication form with session and password encryption using PHP. i cant echo out the username next to welcome under div topline in user_lastname . Go on and login to your WP-admin dashboard with the new password you entered. To create a custom dashboard element called "User Info" to view the current username, email and avatar, insert the code below as a Code snippet: $header = "User Info"; if($_SESSION["user_id"]) {. Pre-Installed Optimized Stack with Git, Composer & SSH, Pardeep is a PHP Community Manager at Cloudways - A Managed PHP Hosting Platform. No two stores are the same and, as such, store owners require reports that fit their needs. Creating a Profile Page After following the procedure above, create a file and save it as home.php. They can revert their Dashboard back to the original blocks as follows: Click the 'Customise this page' button. You could also use a PHP admin template to create a more pleasing-looking admin for the app. login.php (user will login), dashboard.php (user will see the menu/modules), and logout.php (to clear the session). however for this project the difference would be so small, its no issue going to the DB for every call. How do I do this? Then you can check what are the components for logged user can access. In this tutorial, I am going to be creating a working PHP dashboard template with Bootstrap 4.