|
|
Hallo ich bekomme bei mir die meldung:
Das Tag a ist an dieser Stelle nicht erlaubt
diese ist so in einer php datei eingetragen:
if($row["html"] == "1") { $linkus .= '<tr> <td class="tableb" width="15%"><span class="smallfont"><b>HTML-Code:</b></span></td> <td class="tablea" align="center"><textarea rows="3" cols="70"><a href="'.$row["boardaddress"].'" target="_blank">'; if(eregi("http://", $row["gfxaddress"])) { $linkus .= '<img src="'.$row["gfxaddress"].'" border="0" width="'.$row["width"].'" alt="'.$row["description"].'" height="'.$row["height"].'" />'; } else { $linkus .= $row["gfxaddress"]; } $linkus .= '</a></textarea></td> </tr>'; }
|
Wie müsste darin das <textarea eingetragen werden
Gruss
|
|
| 23.10.2006 07:32:19 |
|
HTMELL
Administrator
Registriert: 11.05.2006
Beiträge: 544
|
|
Hallo, innerhalb eines textarea sind überhaupt keine anderen Elemente erlaubt, dort darf nur Text stehen. Wenn jedoch HTML innerhalb eines textarea angezeigt werden soll, dann müssen die spitzen Klammern in Entities umgewandelt werden. Dafür existiert in PHP die Funktion htmlspecialchars().
_______________________________________ mfg Thomas Mell
www.validome.org
|
|
| 23.10.2006 16:54:57 |
|
|
|
Hallo mit den nicht erlaubten elementen meinen sie bestimmt das rows="3" cols="70" dadurch wird die grösse des Feldes in dem der Code angezeigt wird angegeben.Wie müsste das koregt da drinne stehen?
Wie genau meinen sie das mit den Klammern , ich bin was php angeht noch newbie?
Gruss
|
|
| 23.10.2006 17:30:03 |
|
HTMELL
Administrator
Registriert: 11.05.2006
Beiträge: 544
|
|
Hallo,
| mit den nicht erlaubten elementen meinen sie bestimmt das rows="3" cols="70" |
Nein, das sind Attribute. Elemente (oder auch Tags genannt) sind z.B. "a" oder "textarea". Innerhalb des textare-Elementes dürfen keine "<" oder ">" vorkommen, da damit Elemente anfangen und solche dürfen nun mal nicht im textarea-Elementen vorkommen. Die PHP-Funktion htmlspecialchars() wandelt u.a. diese spitzen Klammern in Entities um: Aus htmlspecialchars("<a href=") wird dann "<a href=". So geschrieben darf die Sache im textarea-Element vorkommen. Du kannst natürlich auch per Hand im Code alle "<" durch "<" und ">" durch ">" ersetzen (nur innerhalb des textarea-Elementes.
_______________________________________ mfg Thomas Mell
www.validome.org
|
|
| 23.10.2006 18:38:54 |
|
|
|
Ich habe es nun so:
<textarea rows="3" cols="70"><a href="'.$row["boardaddress"].'" target="_blank">'; if(eregi("http://", $row["gfxaddress"])) { $linkus .= '<img src="'.$row["gfxaddress"].'" border="0" width="'.$row["width"].'" alt="'.$row["description"].'" height="'.$row["height"].'" />'; } else { $linkus .= $row["gfxaddress"]; } $linkus .= '</a></textarea>
|
versucht aber das funktioniert in der php Datei so nicht?
Gruss
|
|
| 23.10.2006 20:58:24 |
|
HTMELL
Administrator
Registriert: 11.05.2006
Beiträge: 544
|
|
Vor dem "<textarea" fehlt wohl noch was...
_______________________________________ mfg Thomas Mell
www.validome.org
|
|
| 23.10.2006 21:47:10 |
|
|
|
Das ist der code
if($row["html"] == "1") { $linkus .= '<tr> <td class="tableb" width="15%"><span class="smallfont"><b>HTML-Code:</b></span></td> <td class="tablea" align="center"><textarea rows="3" cols="70"><a href="'.$row["boardaddress"].'" target="_blank">'; if(eregi("http://", $row["gfxaddress"])) { $linkus .= '<img src="'.$row["gfxaddress"].'" border="0" width="'.$row["width"].'" alt="'.$row["description"].'" height="'.$row["height"].'" />'; } else { $linkus .= $row["gfxaddress"]; } $linkus .= '</a>
|
|
|
| 23.10.2006 21:50:57 |
|
HTMELL
Administrator
Registriert: 11.05.2006
Beiträge: 544
|
|
Code:
if($row["html"] == "1") {
$linkus.= '<tr>
<td class="tableb" width="15%"><span class="smallfont"><b>HTML-Code:</b></span></td>
<td class="tablea" align="center"><textarea rows="3" cols="70">';
$textarea= '<a href="'.$row["boardaddress"].'" target="_blank">';
if(eregi("http://", $row["gfxaddress"])) {
$textarea.= '<img src="'.$row["gfxaddress"].'" border="0" width="'.$row["width"].'" alt="'.$row["description"].'" height="'.$row["height"].'" />';
}
else {
$textarea.= $row["gfxaddress"];
}
$textarea.= '</a>';
$linkus.= htmlspecialchars($textarea) . '</textarea></td></tr>';
} |
Alles klar ? ;-)
_______________________________________ mfg Thomas Mell
www.validome.org
|
|
| 24.10.2006 02:43:02 |
|
|
|
Vielen dank es klappt.
Gruss
|
|
| 24.10.2006 07:58:50 |
|
Wechsel zu
Die letzten Beiträge aus diesen Forum
|
|