hele min header.php ser således ud
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MySite</title>
<link rel="stylesheet" media="screen" type="text/css" href="mycss.css" />
<script language="JavaScript" type="text/javascript" src="myjava.js"></script>
</head>
<body>
<?php
if (isset($_SESSION['logged'])) {
echo '<div class="logged">You are logged in as: ' .$_SESSION['logged']. '</div>';
$userid = ($_SESSION['logged_id']);
db_connect();
$sqlbook = mysql_query("SELECT my_bookmarks.link_id,my_bookmarks.user_id,my_links.url,my_links.id,my_links.title FROM (my_bookmarks,my_links) WHERE my_bookmarks.user_id = ('$userid') AND my_bookmarks.link_id = (my_links.id)");
}
echo'
<div class="outermain"><div class="minwidth"><div class="container">
<h1 class="title" title="MySite">MySite</h1>
<div class="outermenu"><div id="menu">
<ul>
<li><a href="index.php" title="Add links">Start</a></li>
</ul>
<ul>
<li><a href="index.php?action=addlink" title="Add links">Add link</a></li>
</ul>';
if (!isset($_SESSION['logged'])) {
echo'<ul>
<li><a href="index.php?action=login" title="Top links">Login</a></li>
</ul>
<ul>
<li><a href="index.php?action=register" title="Registre at MySite">Register</a></li>
</ul>';
} else {
echo'<ul>
<li><a href="index.php?action=logout" title="Logout of MySite">Logout</a></li>
</ul>
<ul>
<li><a href="#" title="My bookmarks">Bookmarks</a><ul>';
// bookmark menu
while ($bookmarks = mysql_fetch_array($sqlbook)) {
echo '<li class="bmenu"><a href="
http://'.$bookmarks['url'].'" class="bmenu" target="_blank">'.$bookmarks['title'].'</a></li>'; }
echo '</ul></li></ul>'; }
// Settings menu
if (isset($_SESSION['logged'])) {
echo'<ul><li><a href="#">Settings</a>
<ul>';
$bookset = mysql_query("SELECT booksetting,iconset FROM my_users WHERE id = ('$userid') ");
$settings = mysql_fetch_array($bookset);
if (($settings['booksetting']) == 0 ){
echo '<li style="width:100px;text-align:left;overflow:hidden;"><a href="index.php?action=bon">Bookmark ON</a></li>';
}
else if (($settings['booksetting']) == 1 ) {
echo '<li style="width:100px;text-align:left;overflow:hidden;"><a href="index.php?action=boff">Bookmark OFF</a></li>';
}
if (($settings['iconset']) == 0 ){
echo '<li style="width:100px;text-align:left;overflow:hidden;"><a href="index.php?action=ion">Icons ON</a></li>';
}
else if (($settings['iconset']) == 1 ) {
echo '<li style="width:100px;text-align:left;overflow:hidden;"><a href="index.php?action=ioff">Icons OFF</a></li>';
}
echo '</ul></li></ul>';
}
// Partner menu
echo'<ul>
<li><a href="#" title="Top links">Top Links</a>
<ul>';
db_connect();
$partner = mysql_query("SELECT url,title FROM my_links WHERE partner = ('1') ORDER BY RAND() LIMIT 5 ");
while ($partid = mysql_fetch_array($partner)) {
echo'
<li style="width:140px;text-align:left;"><a href="'.$partid['url'].'" target="_blank">'.$partid['title'].'</a></li>';
}
echo'</ul>
</li>
</ul>
</div></div><div class="clr"></div>'; ?>