runnerjp Posted May 9, 2008 Share Posted May 9, 2008 i use this to get user whos logged in ($logged[username]) and i used this to try display there name but i get blank name.. <?php session_start(); require_once '../config.php'; $user = $logged[username]; $query = "SELECT * FROM members WHERE username='$user' "; if ($result = mysql_query($query)) { if (mysql_num_rows($result)) { $array = mysql_fetch_assoc($result); $pemail = $array['Email']; $puser = $array['Username']; $pid = $array['ID']; $pfirst_name = $array['first_name']; $plast_name = $array['last_name']; $pabout_me = $array['about_me']; $pevents = $array['events']; $sql = "SELECT `ext` FROM `user_images` WHERE `user_id`='$pid' LIMIT 1"; } } ?> <div class="c1"> <em>You are logged in as <?php echo $puser; ?>.Your ip address is <?php echo $_SERVER["REMOTE_ADDR"]; ?>; this is stored for security reasons.</em> </div> Link to comment https://forums.phpfreaks.com/topic/104867-cant-display-user-online/ Share on other sites More sharing options...
MadTechie Posted May 9, 2008 Share Posted May 9, 2008 $puser = $array['Username']; should probably be $puser = $array['username']; Link to comment https://forums.phpfreaks.com/topic/104867-cant-display-user-online/#findComment-536731 Share on other sites More sharing options...
radar Posted May 9, 2008 Share Posted May 9, 2008 I was thinking the same thing. Link to comment https://forums.phpfreaks.com/topic/104867-cant-display-user-online/#findComment-536733 Share on other sites More sharing options...
runnerjp Posted May 9, 2008 Author Share Posted May 9, 2008 haha doh simple caps .. didnt see that 1 lol ty Link to comment https://forums.phpfreaks.com/topic/104867-cant-display-user-online/#findComment-536734 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.