thedigicraft / Atom.CMS

Atom.CMS
56 stars 52 forks source link

Part 30 - 31 Display username #71

Open cofcoder opened 9 years ago

cofcoder commented 9 years ago

Hi there Alan,

I am slightly confused why the username is not showing up! I have cross checked it with your file on here and nothing seems to work.

Form navigation.php:

<?php echo $user['fullname']; ?>

From data.php:

function data_user($dbc, $id) {

    $q = "SELECT * FROM users WHERE email = '$id'";
    $r = mysqli_query($dbc, $q);

    $data = mysqli_fetch_assoc($r);

    $data['fullname'] = $data['first'].' '.$data['last'];
    $data['fullname_reverse'] = $data['last'].', '$data['first'];

    return $data;
}

From setup.php:

    # User Setup:
    $user = data_user($dbc, $_SESSION['username']);

I just cannot see where I am going wrong, any ideas where I may be doing something wrong?

thedigicraft commented 9 years ago

Hello!

Lets try this...

Somewhere after the opening <nav> tag:


echo $_SESSION['username'];

See if the email address is outputted

sademban commented 9 years ago

i have same problem here and where should i put echo $_SESSION['username']; in which file???