how to get username on every page in php

Mar 12, 2012   //   by phpfreelancer.biz   //   Blog, MySQL Tutorial  //  No Comments

I wanted to update my column url which is the last visited url of the logged in user i want to retrieve my username of the logged in user

Store it in session:

$_SESSION['username'] = $info['username'];

Then on other pages, you can get it from that:

echo $_SESSION['username'];

Make sure to put session_start() on top of every page where you use it.

Leave a comment

Share This Post

RSS Wordpress News