jeswin12 Posted March 6, 2007 Share Posted March 6, 2007 Hi, I need a tutorial or help to display the username after login. I use php and mysql. Thanks Quote Link to comment Share on other sites More sharing options...
simcoweb Posted March 6, 2007 Share Posted March 6, 2007 You can use a SESSION variable or pass it in the url. Then just echo it: > if passed in the URL $username = $_GET['username']; echo "Welcome back" .$username ; It's not real secure to do it that way, though, since the username is now part of the display of the url in the address bar. I'm sure someone has a better more secure way. Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted March 6, 2007 Share Posted March 6, 2007 or alternatively, you could just GOOGLE IT!!!!!! Quote Link to comment Share on other sites More sharing options...
Snooble Posted March 6, 2007 Share Posted March 6, 2007 array your database SELECT * FROM tablename where fieldname = value and echo from the array produced from the sql above. Many topics cover this. I suggest to search. Snooble Quote Link to comment Share on other sites More sharing options...
Jay2391 Posted March 6, 2007 Share Posted March 6, 2007 my way of doing it !!! ////when he originaly log in i set two sessions one with the user name and one with he's name <?php session_start(); $fname = $_SESSION['fname']; $uname = $_SESSION['user_name']; $online = FALSE; if($_SESSION['session_var'] == "skipLogin"){ echo "$fname is online<br>"; echo "User Name:$uname is online<br>"; echo "<a href=\"user_profile.php\"> Check your user Profile !!!</a><br>"; $online = TRUE; }else{ echo "Status: Offline<br>"; echo "YOU NEED TO LOG-IN FOR REGISTRATION !<br> "; echo "<br><a href=\"login.php\">Log-In </a> or <a href=\"ngl_registration.php\">Register </a>"; $online =FALSE; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.