Prøv koden sådan her:
<?php
$colname_rsSideindhold = "1";
if (isset($_GET['id'])) {
$colname_rsSideindhold = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_cms, $cms);
$query_rsSideindhold = sprintf("SELECT * FROM sideindhold WHERE id = %s ORDER BY id DESC", $colname_rsSideindhold);
$rsSideindhold = mysql_query($query_rsSideindhold, $cms) or die(mysql_error());
$row_rsSideindhold = mysql_fetch_assoc($rsSideindhold);
$totalRows_rsSideindhold = mysql_num_rows($rsSideindhold);
$colname_rsSubmenu = "1";
if (isset($_GET['mainid'])) {
$colname_rsSubmenu = (get_magic_quotes_gpc()) ? $_GET['mainid'] : addslashes($_GET['mainid']);
}
mysql_select_db($database_cms, $cms);
$query_rsSubmenu = sprintf("SELECT * FROM sideindhold WHERE mainid = %s", $colname_rsSubmenu);
$rsSubmenu = mysql_query($query_rsSubmenu, $cms) or die(mysql_error());
$row_rsSubmenu = mysql_fetch_assoc($rsSubmenu);
$totalRows_rsSubmenu = mysql_num_rows($rsSubmenu);
include('config.php');
$name = strip_tags($_POST['name']);
$message = htmlspecialchars($_POST['message']);
$email = strip_tags($_POST['email']);
if (isset($_POST['cookie'])) {
setcookie('name',$_POST['name'],time()+2592000);
setcookie('email',$_POST['email'],time()+2592000);
}
if ($_POST['prfm'] == 'new') {
$header = strip_tags($_POST['header']);
if (!empty($header) && !empty($name) && !empty($message)) {
mysql_query("INSERT INTO forum VALUES ('','$header','$name','$email',now(),'$message','')") or die(mysql_error());
$id = mysql_insert_id();
header("Location: laes.php?id=$id");
} else {
$error = '<font color="red">Alle felter er ikke udfyldt!</font>';
}
}
if ($_POST['prfm'] == 'comment') {
$parent = $_POST['parent'];
if (!empty($name) && !empty($message)) {
mysql_query("INSERT INTO forum VALUES ('','','$name','$email',now(),'$message','$parent')") or die(mysql_error());
header("Location: laes.php?id=$parent");
} else {
$error = '<font color="red">Alle felter er ikke udfyldt!</font>';
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>Xplayed.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #7F7F7F}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
-->
</style>
</head>
<body>
<table width="70%" border="0" align="left" cellpadding="0" cellspacing="0" class="layout">
<tr>
<td colspan="2"><img src="img/banner.gif" width="600" height="150" border="0" usemap="#Map"></td>
<td width="27%"></td>
</tr>
<tr>
<td width="18%" class="top1"><div align="center" class="style1">
<?php
$dDagNumMaaned = date('j');
$dMaanedNumAar = date('n');
$dAarNu = date('Y');
$dDagNumUge = date('w');
$dagNavn = array(
"Søndag",
"Mandag",
"Tirsdag",
"Onsdag",
"Torsdag",
"Fredag",
"Lørdag"
);
$maanedNavn = array(
"Januar",
"Februar",
"Mars",
"April",
"Maj",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"December"
);
$dagNavn = htmlentities($dagNavn[$dDagNumUge]);
$maanedNavn = htmlentities($maanedNavn[$dMaanedNumAar-1]);
echo "$dagNavn, $dDagNumMaaned $maanedNavn - $dAarNu";
?>
</div></td>
<td colspan="2" class="top1"><a href="index.php?id=1&mainid=1">Forside</a> <span class="style1">| <a href="index.php?id=3&mainid=3">Members</a> | </span> <a href="index.php?id=2&mainid=2">Info</a> <span class="style1">|</span> <a href="forum.php">Forum</a> <span class="style1">|</span> <a href="index.php?id=4&mainid=4">Galleri</a> <span class="style1">|</span> <a href="index.php?id=5&mainid=5">Links</a></td>
</tr>
<tr>
<td class="left"><p> </p>
<?php do { ?>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="center" valign="top"><a href="index.php?id=<?php echo $row_rsSubmenu['id']; ?>&mainid=<?php echo $row_rsSubmenu['mainid']; ?>"><?php echo $row_rsSubmenu['navn']; ?></a></td>
</tr>
</table>
<?php } while ($row_rsSubmenu = mysql_fetch_assoc($rsSubmenu)); ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="menu"> </td>
</tr>
</table>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="
http://www.brokenspirits.dk/" target="_blank"><img src="img/BAnner%20mini.jpg" width="88" height="31" border="0"></a></td>
</tr>
</table> <p> </p>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="info" id=".info">
<tr>
<td align="center"><?
$ip = getenv("REMOTE_ADDR");
$fil = "count.txt";
$f = file($fil);
$antal = count($f);
$yest = time() - 1800;
$o = "0";
$xidag = "f";
$idag = time();
$idag2 = date("Y F d, H:i");
while ($antal > $o) {
$streg = explode(" ", $f[$o]);
if ($ip == $streg[0]) {
$x = "t";
if ($streg[1] > $yest) {
$xidag = "t";
}
}
$o++;
}
if ($xidag == "f") {
$logg = fopen("$fil", "a");
fputs ($logg, "$ip $idag, $idag2\n");
fclose ($logg);
}
$f = file($fil);
$antal = count($f);
if ($x == "t") {
print "Besøg ialt: $antal";
}
else {
print "Besøg ialt: $antal";
}
?>
<div align="center"></div></td>
</tr>
<tr>
<td align="center">Der er nu:
<?php include("useronline.php"); ?> Online</td>
</tr>
<tr>
<td align="center"><?
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
$start = getmicrotime();
?>
<?
$end = getmicrotime();
$time = $end - $start;
$time = substr($time,0,10);
?>
Load: <b>
<?=$time?>
</b> sek</td>
</tr>
</table></td>
</tr>
</table>
</td>
<td colspan="2" class="middle"><form name="form1" method="get" action="resultat.php">
<table width="200" border="0" align="right" cellpadding="2" cellspacing="0">
<tr>
<td><input name="search" type="text" id="search"></td>
<td><input type="submit" name="Submit" value="Søg"></td>
</tr>
</table>
</form>
<p> </p>
<table width="90%" border="0" cellpadding="5">
<tr>
<td><h1>Forum</h1></td>
</tr>
<tr>
<td>
<?php
if (isset($error)) {
print "$error";
}
?>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<p> </p></td>
</tr>
</table>
<map name="Map">
<area shape="circle" coords="470,101,15" href="admin/index.php">
<area shape="circle" coords="437,98,1" href="#">
</map>
</body>
</html>
<?php
mysql_free_result($rsSideindhold);
mysql_free_result($rsSubmenu);
?>