Jump to content

cant display user online


runnerjp

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.