Witam mam problem z validacja kodu php. Co jest nie tak z tym PHP?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<p>Login**: <input type="text" name="login" id="l" value="<?php print $l; ?>" size="30" maxlength="30" /><br /></p>
Wynik walidacji to:
[kod=html]…ype="text" name="login" id="l" value="<?php print $l; ?>" size="30" maxlength=…[/kod]
Opis błedu:
[quote]Line 98, Column 59: character "<" is the first character of a delimiter but
This message may appear in several cases:
•You tried to include the "<" character in your page: you should escape it as "<"
•You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&", which is always safe.
•Another possibility is that you forgot to close quotes in a previous tag.[/quote]
to zaznaczony na czerwono "<" przed <?php.
i drugi problem z znacznikiem i
<table border="1"><tbody>
<thead>
<tr><th>Login</th><th>Uprawnienia</th><th>Imie</th><th>Nazwisko</th><th>Telelefon</th></tr>
<?php
$db = new PDO('mysql:host=localhost;dbname=kino', klient, klient);
$sql="SELECT login, upr, imie, nazwisko, tel FROM klienci WHERE login='$login' ";
$res=$db->query($sql);
while($row = $res->fetch())
{
print '<td><a href="edycja_kont.php?akcja=edytuj">'.$row['login'].'</td>';
print '<td>'.$row['upr'].'</td>';
print '<td>'.$row['imie'].'</td>';
print '<td>'.$row['nazwisko'].'</td>';
print '<td>'.$row['tel'].'</td></tr>'.PHP_EOL;
}
?>
</thead></tbody></table>` `
Line 55, Column 7: document type does not allow element "thead" here<thead>
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).[/quote]
[quote]Line 75, Column 16: end tag for "tbody" which is not finished</thead></tbody></table>
Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>
Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists require appropriate list items (<ul> and <ol> require <li>; <dl> requires <dt> and <dd>), and so on
Wydaje mi się że znaczniki <tbody> <thead> są w dobrej kolejności pozamykane, są z małej litery i wszystkie są zamknięte "/".
O co biega???