Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Show logged in users username, instead of it showing my database user?

Featured Replies

Hey, havent touched PHP in a good 6 months and even then i spent a couple of weeks with it. I created a simple login / out with profile page and decided to play around with it today.

 

I want to show the username of the logged in user on the profile page but when using:

 

echo($_SESSION['username']);

 

it shows my database username...

 

Any help?

Hey, havent touched PHP in a good 6 months and even then i spent a couple of weeks with it. I created a simple login / out with profile page and decided to play around with it today.

 

I want to show the username of the logged in user on the profile page but when using:

 

echo($_SESSION['username']);

 

it shows my database username...

 

Any help?

 

mmm more then likely your storing your database username in the session $_SESSION['username'] when creating the session. and im not sure i know what you mean by logged in username and database username should they not be the same?

when you are logging the user in , store the username in it like :

$_SESSION['user_name']=$username;

 

when you say

it shows my database username...

I'm assuming you have an admin area too,but it shows your username instead of users .

if this is the case ,try to save the users username in different session,this will solve your problem.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.