Hi
Wenn ich die Seite, eine Abfrage einer DB ohne <?php session_start();?> mache ist der hTML-Validator im grünen Bereich. Sobald ich die SESSION hinschreibe kommen 13 Fehler!
Mein ganzer Code
PHP-Code:
<?php session_start();
unset($_SESSION);?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Quartierfest </title>
<link href="../includes/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
$link = mysql_pconnect("localhost","db1","pw");
mysql_select_db("tb2",$link);
?>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan='2'><hr width="100%" size="1" noshade="noshade" /> </td>
</tr>
<tr valign="top">
<td class="nav2">
<!--START NAVIGATION -->
<table width="250" border="0" cellspacing="0" cellpadding="0">
<?
$query = "SELECT * FROM navigation WHERE upperlevel=0 ORDER BY orderkey ASC";
$result = mysql_query($query,$link);
while($row = mysql_fetch_array($result))
{
$navigationid1=$row["navigationid"];
$navtext1=$row["navtext"];
?>
<tr >
<td height='12'> <a class='nav1' href='details.php?id=<? echo"$navigationid1";?>'><? echo"$navtext1";?></a></td>
</tr>
<tr>
<td > </td>
</tr>
<? }
?>
</table>
<!--ENDE NAVIGATION -->
</td>
<td>
<!-- CONTENT BEREICH -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr >
<td> </td>
<td> </td>
</tr>
<tr>
<td width="10"> </td>
<td class="pagetitle"> Inhalt folgt </td>
</tr>
</table>
<!-- ENDE CONTENT BEREICH -->
</td>
</tr>
</table>
</body>
</html>
Im Browser ist alles richtig angezeigt, doch eben der Validator will nicht. Es ist die erste Seite die ich aufgerufen wird, trotzdem habe ich unset($_SESSION); gemacht, damit nichts altes mehr drin ist.
Sobald ich session_start() setze bringt mir der Validator 13 Fehler! Alle mit Hinweis aus die Session. Klar steht was da, aber ich schnall es nicht!
Der Validator schlägt mir vor
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
einzusetzen statt
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
Doch dann kann er gar nicht mehr validieren.
Was mache ich falsch? Wo steckt der Wurm?
Hier noch ein Auszug, der Anfang der beiden Validatorentexte
PHP-Code:
Total 13 Fehler und Warnungen
Warning Line 32, Column 69: cannot generate system identifier for general entity "PHPSESSID".
Error Line 32, Column 69: general entity "PHPSESSID" not defined and no default entity.
Warning Line 32, Column 78: reference not terminated by REFC delimiter.
PHP-Code:
Sorry, I am unable to validate this document because on line 37 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.
The error was: utf8 "\xD6" does not map to Unicode
Bisher habe ich miene Seite nicht so genau getestet, aber da sie in Vista nicht lief, suche ich den Grund und fand diese Fehler im Validator
Danke
Theresa