Fejl ved validering af hjemmeside
Jeg får 4 fejl ved validering af index.php?pageid=3, men jeg kan ikke lige gennemskue hvordan jeg retter dem.:Validation Output: 4 Errors
1. Error Line 151, Column 7: end tag for "DIV" omitted, but its declaration does not permit this
</body>
✉
* You forgot to close a tag, or
* you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.
The next message, "start tag was here" points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.
2. Info Line 60: start tag was here
><div class="sideskift">
3. Error Line 151, Column 7: end tag for "DIV" omitted, but its declaration does not permit this
</body>
✉
* You forgot to close a tag, or
* you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.
The next message, "start tag was here" points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.
4. Info Line 42, Column 1: start tag was here
<div id="contentmidt">
5. Error Line 151, Column 7: end tag for "DIV" omitted, but its declaration does not permit this
</body>
✉
* You forgot to close a tag, or
* you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.
The next message, "start tag was here" points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.
6. Info Line 40, Column 1: start tag was here
<div id="content">
7. Error Line 151, Column 7: end tag for "DIV" omitted, but its declaration does not permit this
</body>
✉
* You forgot to close a tag, or
* you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.
The next message, "start tag was here" points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.
8. Info Line 13: start tag was here
><div id="center">
index.php:
<?php session_start();?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<?
$pageid = $_GET['pageid'];
?>
<html>
<head>
<title>test</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="center">
<div id="banner">
</div>
<div id="menu">
<div id="menutop"><h1>Menu</h1></div>
<div id="menucontent">
<?
include "menu.php";
?>
</div>
<div id="menubund"></div>
</div>
<div id="content">
<div id="contenttop"></div>
<div id="contentmidt">
<?
if($pageid == "1"){ include("content/forside.php");
}
else if($pageid == "2"){ include("content/info.php");
}
else if($pageid == "3"){ include("content/nyheder.php");
}
else if($pageid == "4"){ include("content/aktiviteter.php");
}
else if($pageid == "5"){ include("content/skadesliste.php");
}
else if($pageid == "6"){ include("content/links.php");
}
else if($pageid == "7"){ include("content/sitemap.php");
}
else if($pageid == "8"){ include("admin/login/adduser.php");
}
else if($pageid == "9"){ include("admin/login/adduser_confirm.php");
}
else if($pageid == "10"){ include("admin/login/login.php");
}
else if($pageid == "11"){ include("admin/login/login_confirm.php");
}
else if($pageid == "12"){ include("admin/login/login_req.php");
}
else if($pageid == "13"){ include("nyhedsarkiv/add.php");
}
else if($pageid == "14"){ include("nyhedsarkiv/add-ok.php");
}
else if($pageid == "15"){ include("nyhedsarkiv/forside/add.php");
}
else if($pageid == "16"){ include("nyhedsarkiv/admin_link.php");
}
else if($pageid == "17"){ include("nyhedsarkiv/link_edit_ok.php");
}
else if($pageid == "18"){ include("nyhedsarkiv/forside/add-ok.php");
}
else if($pageid == "19"){ include("nyhedsarkiv/forside/admin_link.php");
}
else if($pageid == "20"){ include("nyhedsarkiv/forside/link_edit_ok.php");
}
else if($pageid == "21"){ include("nyhedsarkiv/info/add.php");
}
else if($pageid == "22"){ include("nyhedsarkiv/info/add-ok.php");
}
else if($pageid == "23"){ include("nyhedsarkiv/info/admin_link.php");
}
else if($pageid == "24"){ include("nyhedsarkiv/info/link_edit_ok.php");
}
else if($pageid == "25"){ include("nyhedsarkiv/aktiviteter/add.php");
}
else if($pageid == "26"){ include("nyhedsarkiv/aktiviteter/add-ok.php");
}
else if($pageid == "27"){ include("nyhedsarkiv/aktiviteter/admin_link.php");
}
else if($pageid == "28"){ include("nyhedsarkiv/aktiviteter/link_edit_ok.php");
}
else { include("content/forside.php");
}
?>
</div>
<div id="contentbund"><br><br></div>
</div>
</div>
</body>
</html>
nyheder.php
<?php
if($_SESSION['rank'] == 1){
?>
<?
require("config.php");
$pr_side = 5;
$antal = mysql_result(mysql_query("SELECT COUNT(*) FROM nyhedsdatabase"),0) or die(mysql_error());
$vis_fra = (isset($_GET["visfra"]) && is_numeric($_GET["visfra"]) && $_GET["visfra"] < $antal) ? $_GET["visfra"] : 0;
$query = mysql_query("SELECT overskrift, url, kilde, type, beskrivelse, DATE_FORMAT(CONVERT_TZ(datetime, '+00:00', '+01:00'), '%d-%m-%Y %H:%i:%s') as dato, id FROM nyhedsdatabase ORDER BY dato desc, overskrift limit $vis_fra, $pr_side") or die(mysql_error());
while($row = mysql_fetch_assoc($query)) {
define('MAX_HEADLINE_WIDTH', 25);
$link = (strlen($row['url'])>MAX_HEADLINE_WIDTH) ? substr($row['url'], 0, MAX_HEADLINE_WIDTH-3)."..." : $row['url'];
?>
<?php
$newurl = htmlspecialchars("$row[url]", ENT_QUOTES);
?>
<?php
$link = htmlspecialchars("$link", ENT_QUOTES);
?>
<div class="indholdtop"><?php echo"<h1>".$row['overskrift']."</h1><h2>Tilføjet: ".$row['dato']." af Webmaster</h2>"; ?></div>
<div class="indholdcontent">
<div class="news"><?php echo"<b>Link:</b><a href=\"http://".$newurl."\" target=\"_blank\">".$link."</a>"; ?></div>
<div class="news"><?php echo"<b>Kilde:</b> ".$row['kilde']." ";?></div>
<div class="news"><?php echo"<b>Type:</b> ".$row['type'].""; ?></div><br>
<div class="news"><?php echo"<b>Beskrivelse:</b><br>".$row['beskrivelse'].""; ?></div>
<br>
<div class="news"><?php echo"<a href=\"index.php?pageid=16&id=".$row['id']."\">Ret/Slet</a> "; ?></div>
</div>
<div class="indholdbund"></div>
<br><br>
<div class="sideskift">
<?php
}
if ($vis_fra > 0) {
$back= $vis_fra - $pr_side;
echo "<a href='$_SERVER[PHP_SELF]?pageid=3&visfra=$back'><</a>";
}
$page = 1;
for ($start = 0; $antal > $start; $start = $start + $pr_side) {
if($vis_fra != $page * $pr_side - $pr_side) {
echo "<a href='$_SERVER[PHP_SELF]?pageid=3&visfra=$start'>$page</a>";
} else {
echo"<B>$page</B>";
}
$page++;
}
if ($vis_fra < $antal - $pr_side) {
$next = $vis_fra + $pr_side;
echo "<a href='$_SERVER[PHP_SELF]?pageid=3&visfra=$next'>></a>";
}
?>
</div>
<?php
} else {
require("config.php");
$pr_side = 5;
$antal = mysql_result(mysql_query("SELECT COUNT(*) FROM nyhedsdatabase"),0) or die(mysql_error());
$vis_fra = (isset($_GET["visfra"]) && is_numeric($_GET["visfra"]) && $_GET["visfra"] < $antal) ? $_GET["visfra"] : 0;
$query = mysql_query("SELECT overskrift, url, kilde, type, beskrivelse, DATE_FORMAT(CONVERT_TZ(datetime, '+00:00', '+01:00'), '%d-%m-%Y %H:%i:%s') as dato, id FROM nyhedsdatabase ORDER BY dato desc, overskrift limit $vis_fra, $pr_side") or die(mysql_error());
while($row = mysql_fetch_assoc($query)) {
define('MAX_HEADLINE_WIDTH', 25);
$link = (strlen($row['url'])>MAX_HEADLINE_WIDTH) ? substr($row['url'], 0, MAX_HEADLINE_WIDTH-3)."..." : $row['url'];
?>
<?php
$newurl = htmlspecialchars("$row[url]", ENT_QUOTES);
?>
<?php
$link = htmlspecialchars("$link", ENT_QUOTES);
?>
<div class="indholdtop"><?php echo"<h1>".$row['overskrift']."</h1><h2>Tilføjet: ".$row['dato']." af Webmaster</h2>"; ?></div>
<div class="indholdcontent">
<div class="news"><?php echo"<b>Link:</b><a href=\"http://".$newurl."\" target=\"_blank\">".$link."</a>"; ?></div>
<div class="news"><?php echo"<b>Kilde:</b> ".$row['kilde']." ";?></div>
<div class="news"><?php echo"<b>Type:</b> ".$row['type'].""; ?></div><br>
<div class="news"><?php echo"<b>Beskrivelse:</b><br>".$row['beskrivelse'].""; ?></div>
</div>
<div class="indholdbund"></div>
<br><br>
<div class="sideskift">
<?php
}
if ($vis_fra > 0) {
$back= $vis_fra - $pr_side;
echo "<a href='$_SERVER[PHP_SELF]?pageid=3&visfra=$back'><</a> ";
}
$page = 1;
for ($start = 0; $antal > $start; $start = $start + $pr_side) {
if($vis_fra != $page * $pr_side - $pr_side) {
echo "<a href='$_SERVER[PHP_SELF]?pageid=3&visfra=$start'>$page</a>";
} else {
echo"<b>$page</b>";
}
$page++;
}
if ($vis_fra < $antal - $pr_side) {
$next = $vis_fra + $pr_side;
echo "<a href='$_SERVER[PHP_SELF]?pageid=3&visfra=$next'>></a>";
}
?>
<?php
}
?>
</div>
Ligeledes har jeg svært ved at gennemskue om php-koen i nyheder.php er valid.
Jeg håber I kan hjælpe.
- XuZeM
