MIn index ser således ud:
<?php include('Connections/cms.php'); ?>
<?
mysql_select_db($database_cms, $cms);
$query_Rstop1 = "SELECT navn, topid FROM Cms_indhold WHERE topid = '1'";
$Rstop1 = mysql_query($query_Rstop1, $cms) or die(mysql_error());
$row_Rstop1 = mysql_fetch_assoc($Rstop1);
$totalRows_Rstop1 = mysql_num_rows($Rstop1);
mysql_select_db($database_cms, $cms);
$query_RsTop2 = "SELECT navn, topid FROM Cms_indhold WHERE topid = '2'";
$RsTop2 = mysql_query($query_RsTop2, $cms) or die(mysql_error());
$row_RsTop2 = mysql_fetch_assoc($RsTop2);
$totalRows_RsTop2 = mysql_num_rows($RsTop2);
mysql_select_db($database_cms, $cms);
$query_RsTop3 = "SELECT navn, topid FROM Cms_indhold WHERE topid = '3'";
$RsTop3 = mysql_query($query_RsTop3, $cms) or die(mysql_error());
$row_RsTop3 = mysql_fetch_assoc($RsTop3);
$totalRows_RsTop3 = mysql_num_rows($RsTop3);
mysql_select_db($database_cms, $cms);
$query_RsTop4 = "SELECT navn, topid FROM Cms_indhold WHERE topid = '4'";
$RsTop4 = mysql_query($query_RsTop4, $cms) or die(mysql_error());
$row_RsTop4 = mysql_fetch_assoc($RsTop4);
$totalRows_RsTop4 = mysql_num_rows($RsTop4);
mysql_select_db($database_cms, $cms);
$query_RsTop5 = "SELECT navn, topid FROM Cms_indhold WHERE topid = '5'";
$RsTop5 = mysql_query($query_RsTop5, $cms) or die(mysql_error());
$row_RsTop5 = mysql_fetch_assoc($RsTop5);
$totalRows_RsTop5 = mysql_num_rows($RsTop5);
?><?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_RSsideindhold = "1";
if (isset($_GET['id'])) {
$colname_RSsideindhold = $_GET['id'];
}
mysql_select_db($database_cms, $cms);
$query_RSsideindhold = sprintf("SELECT * FROM Cms_indhold WHERE id = %s ORDER BY id ASC", GetSQLValueString($colname_RSsideindhold, "int"));
$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['mainid'];
}
mysql_select_db($database_cms, $cms);
$query_rsSubmenu = sprintf("SELECT * FROM Cms_indhold WHERE mainid = %s", GetSQLValueString($colname_rsSubmenu, "int"));
$rsSubmenu = mysql_query($query_rsSubmenu, $cms) or die(mysql_error());
$row_rsSubmenu = mysql_fetch_assoc($rsSubmenu);
$totalRows_rsSubmenu = mysql_num_rows($rsSubmenu);
?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="css/styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="layout">
<tr>
<td colspan="2" class="top"><img src="img/toplogo.gif" alt="Cms-Logo" width="115" height="72" /></td>
</tr>
<tr>
<td width="18%" height="24" class="top1"> </td>
<td class="top1"><a href="index.php?id=1&mainid=1"><?php echo $row_Rstop1['navn']; ?></a> | <a href="index.php?id=2&mainid=2"><?php echo $row_RsTop2['navn']; ?></a> | <a href="index.php?id=3&mainid=3"><?php echo $row_RsTop3['navn']; ?></a> | <a href="index.php?id=4&mainid=4"><?php echo $row_RsTop4['navn']; ?></a> | <a href="index.php?id=5&mainid=5"><?php echo $row_RsTop5['navn']; ?></a></td>
</tr>
<tr>
<td width="16%" height="68" class="left"><form id="form1" name="form1" method="get" action="resultat.php">
<table width="100%" border="0" align="right" cellpadding="2" cellspacing="0">
<tr>
<td width="100%" height="68" class="left">
<input name="search" type="text" id="search" size="18" />
<input type="submit" name="Submit" value="Søg" /> </td>
</tr>
</table>
<p></p>
</form></p></td>
<td rowspan="2" class="middle"><p> </p>
<table width="100%" border="0">
<tr>
<td><h1><?php echo $row_RSsideindhold['overskrift']; ?></h1></td>
</tr>
<tr>
<td><?php echo $row_RSsideindhold['tekst1']; ?></td>
</tr>
<tr>
<td><?php if ($row_RSsideindhold['billede']) {
echo '<img src="admin/billeder/'.$row_RSsideindhold['billede'].'">';} ?> </td>
</tr>
<tr>
<td><?php echo $row_RSsideindhold['tekst2']; ?></td>
</tr>
</table> </td>
</tr>
<tr class="left">
<td><?php do { ?>
<div align="left"> <a href="index.php?id=<?php echo $row_rsSubmenu['id']; ?>&mainid=<?php echo $row_rsSubmenu['mainid']; ?>"><?php echo $row_rsSubmenu['navn']; ?></a></div>
<?php } while ($row_rsSubmenu = mysql_fetch_assoc($rsSubmenu)); ?></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($RSsideindhold);
mysql_free_result($rsSubmenu);
mysql_free_result($rstop1);
?>
Skal lige siges det er lavet via DW