- Readme First! - Read and follow the rules, otherwise your posts will be closed
There are currently, 47 guest(s) and 0 member(s) that are online. You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Why Won't This Work... Login/Logout link in header [ ]
Author
Message
Jolanta
Nuke Cadet
Joined: Nov 04, 2006
Posts: 2
Posted:
Sun Nov 05, 2006 12:10 am
Hi
I am trying to get a "login" link to appear in the header for all visitors which dynamically changes to a "logout" link when a user is logged in.
Can anyone shed any light on why this wont work... the code seems fine to me... I have tried everything to get it working with no success.
HERE IS THE theme header function
Code:
function themeheader() {
global $banners, $sitename, $login;
if ($banners) {
include("banners.php");
/* User info */
cookiedecode($user);/* Get cookie info */
$ip = $_SERVER["REMOTE_ADDR"];
$username = $cookie[1];
if (!isset($username)) {
$username = "$ip";
$guest = 1;
}
if (is_admin($admin)) {/* Display if administrator */
$login = ""._ADMIN." <a href=\"admin.php?op=logout\"> "._LOGOUT."</a> ";/* Admin:[ Logout ] */
}
if (is_user($user)) {/* Display if registered user */
$login .= "<a href=\"modules.php?name=Your_Account&op=logout\">"._LOGOUTHOMEPAGE." </a>";
}
else {/* Display if anonymous user */
$login .= "<a href=\"modules.php?name=Your_Account&op=login\">"._LOGINHOMEPAGE." </a>";
}
}
and here is the call to display the login or logout link
Code:
echo "<tr align='center'>";
echo "<td width='20%'><a href='index.php'>home</a></td>";
echo "<td width='20%'><a href='modules.php?name=About-Us'>about</a></td>";
echo "<td width='20%'><a href='faq.html'>faqs</a></td>";
echo "<td width='20%'><a href='modules.php?name=Feedback'>contact</a></td>";
echo "<td width='20%'>";
echo "$login";
echo "</td>";
echo "</tr>";
If anyone can point me in the right direction I would really appreciate it
Thanks
Jolanta
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12403
Posted:
Tue Nov 07, 2006 7:00 am
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum