as4s1n
New Member
- Messages
- 174
- Reaction score
- 4
- Points
- 0
When people log into my site up at the top right shows their profile picture, a link to their account and a sign out link (regular user). But whenever people log in the top right is invisible, even on the source. Only the admin and not logged in users (register & log-in) can see it.
I have no idea what is wrong
PHP:
<?php
$name = (isset($_SESSION['loggedin'])) ? $_SESSION['loggedin'] : '0';
if($name == '0') {
echo "<a href=\"index.php?p=signInForm\">Log in</a> \n";
echo "<a href=\"index.php?p=registerForm\">Register</a>\n";
} else {
$sth = $dbh->query("SELECT id,username,avatar,admin FROM users WHERE username = '$name'");
while($row=$sth->fetch()){
$userID = $row['id'];
$username = $row['username'];
$avatar = $row['avatar'];
$admin = $row['admin'];
echo "<a href=\"http://x10hosting.com/forums/images/userImages/avatars/$avatar\"><img src=\"http://x10hosting.com/forums/images/userImages/avatars/$avatar\" width='50' height='50' align='left' /></a><br />\n";
echo "Welcome $username<br />\n";
echo "<a href=\"index.php?p=viewProfile&id=$userID\">My profile page</a><br />\n";
echo "<a href=\"index.php?p=signOutFinish\">Sign Out</a>\n";
if($admin == 1) {
echo "<a href=\"index.php?p=admin/admin_checkentries\">Administration</a>";
}
}
}
?>
I have no idea what is wrong
Last edited: