[XHTML] Validierungsproblem

MarcDK

Banned
Registriert
Mai 2001
Beiträge
3.559
Code:
 <?xml version="1.0" encoding="iso-8859-1" ?> 
 <!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" xml:lang="en" lang="en"> 
 <head> 
 <link rel="stylesheet" href="style.css" type="text/css" /> 
 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> 
 <title>pixer gallery</title> 
 </head> 
 <body> 
 <h1><a href="index.php"></a></h1> 
 <div id="gallery"> 
 <a href="?path=">Gallery</a>
/<a href="?path=rock">rock</a>
 /<br /><a href="index.php?path=rock&amp;img=img_0007.JPG">&lt; &lt; (previous)</a>&nbsp;&nbsp;img_0008 (9/121)&nbsp;&nbsp;<a href="index.php?path=rock&amp;img=img_0009.JPG">(next) &gt; &gt;</a><br /><a href="index.php?path=rock&amp;img=img_0009.JPG"><img src="rock/img_0008.JPG" alt="img_0008.JPG - large - click to jump to the next picture!" /><br /><a href="index.php?path=rock&amp;img=img_0007.JPG">&lt; &lt; (previous)</a>&nbsp;&nbsp;img_0008 (9/121)&nbsp;&nbsp;<a href="index.php?path=rock&amp;img=img_0009.JPG">(next) &gt; &gt;</a><br /></a><form method="post" action="">Kommentare:<br /><input type="hidden" name="path" value="rock" /><input type="hidden" name="img" value="img_0008.JPG" /><input type="hidden" name="text" value="" /><input type="text" size="60" name="addcomment" /><input type="submit" value="add" /></form><table><tr><td></td></tr></table></div><div id="bottom">copyright © 2003 <a href="http://www.toensing.com">www.toensing.com</a></div>
 </body></html>

Hi! Er meckert beim validieren und zwar so:

Line 15, column 401: document type does not allow element "a" here; missing one of "object", "span", "bdo", "applet", "iframe", "tt", "i", "b", "u", "s", "strike", "big", "small", "font", "em", "strong", "dfn", "code", "q", "samp", "kbd", "var", "cite", "abbr", "acronym", "sub", "sup", "label", "ins", "del" start-tag

...x.php?path=rock&amp;img=img_0007.JPG">&lt; &lt; (previous)</a>&nbsp;&nbsp;img


Also das ist ja im prinzip im <a>-Tag die "href"-value die er anmeckert weil da so viele Variablen übergeben werden und das mag XHTML wohl nicht.


Wie kann man das umgehen?
 
Re: XHTML & php Variablenübergabe-Problem

MarcDK schrieb:
{code}
Hi! Er meckert beim validieren und zwar so:

Line 15, column 401: document type does not allow element "a" here; missing one of "object", "span", "bdo", "applet", "iframe", "tt", "i", "b", "u", "s", "strike", "big", "small", "font", "em", "strong", "dfn", "code", "q", "samp", "kbd", "var", "cite", "abbr", "acronym", "sub", "sup", "label", "ins", "del" start-tag

...x.php?path=rock&amp;img=img_0007.JPG">&lt; &lt; (previous)</a>&nbsp;&nbsp;img


Also das ist ja im prinzip im <a>-Tag die "href"-value die er anmeckert weil da so viele Variablen übergeben werden und das mag XHTML wohl nicht.


Wie kann man das umgehen?
Öhm... wie wäre es wenn du deinen Code mal vernünftig strukturierst?
Dann sähe das so aus:
HTML:
<a href="index.php?path=rock&amp;img=img_0007.JPG">&lt; &lt; (previous)</a>&nbsp;&nbsp;img_0008 (9/121)&nbsp;&nbsp;
<a href="index.php?path=rock&amp;img=img_0009.JPG">(next) &gt; &gt;</a><br />
<a href="index.php?path=rock&amp;img=img_0009.JPG"><img src="rock/img_0008.JPG" alt="img_0008.JPG - large - click to jump to the next picture!" /><br />
<a href="index.php?path=rock&amp;img=img_0007.JPG">&lt; &lt; (previous)</a>&nbsp;&nbsp;img_0008 (9/121)&nbsp;&nbsp;
<a href="index.php?path=rock&amp;img=img_0009.JPG">(next) &gt; &gt;</a><br /></a>

So, jetzt schaus dir nochmal selber an, der Fehler ist extrem billig.
Oder seit wann benutzt man <a href="page1">text <a href="page2">mehr text</a></a>
 
Re: XHTML & php Variablenübergabe-Problem

ok, dankeschön! Ich hatte wohl vergessen, die <a>-Tags zu zumachen =)
 
Re: XHTML & php Variablenübergabe-Problem

Du hast btw den Sinn des ALT-Attributs nicht verstanden...
alt="img_0008.JPG - large - click to jump to the next picture!"

Der ALTernativ wird ANSTELLE des Bildes angezeigt.
Was du suchst ist TITLE=
 
Re: XHTML & php Variablenübergabe-Problem

Sag mal, ich glaube du spinnst. Bin ich jetzt dein privater Validatorservice oder was?
 
Ne, sie validieren ja.

Es hätte ja sein können, dass Dir Sachen auffallen, die Du vielleicht anders machen würdest.

Valideren kann ich ja selber. =)
 
Re: XHTML & php Variablenübergabe-Problem

The Prophet schrieb:
Danke für die Hilfe. =)

Ja, wenn es fertig ist. Es macht sogar die Watermarks drauf! =)
 
Re: XHTML & php Variablenübergabe-Problem

Gut dann meld ich schonmal interesse an :) Irgendwann brauch sowas auch mal!
 
MarcDK schrieb:
Ne, sie validieren ja.

Es hätte ja sein können, dass Dir Sachen auffallen, die Du vielleicht anders machen würdest.

Valideren kann ich ja selber. =)
Ok, sorry, ich bin es bloss gewohnt, dass die Leute immer andere ihre Arbeit machen lassen wollen...
Und wenn dann zum 87. Mal am Tag jemand in dem Programmierforum wo ich FB bin eine Anfrage nach kostenlosem Webspace postet, obwohl es da dick und fett einen Sammelthread gibt, auf den sogar sowohl in den Regeln als auch in der FAQ verwiesen ist, trägt das auch nicht sonderlich zum heben der Stimmung bei...

In dem Sinne nochmal:
Tut mir leid.

Btw: Wenn er validiert ist doch alles ok? Dein <a><a></a></a> von vorhin sollte schon einen Validierungsfehler erzeugen...
 
Das hatte ich ja auf dein Anraten gefixt. =)
 
Zurück
Oben