Willkommen in der Webstatt Zum Webstatt Blog und Stories
BNightSpeeder am 25.05.06 14:40

Hallo,

volgendes Problem ich möchte einen HTML-Code einer Variable zu weisen, aber leider geht das nicht:

<?php
/* SMILIES EINGABE FORMULAR ANFANG */
$Variable =
?>
<table width="80" height="160" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" class="tabletitle" align="left">Smilies:</td>
</tr>
<tr>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':)')"><img class="noimg" src="./images/smilies/15.gif" title=":)" alt=":)"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':D')"><img class="noimg" src="./images/smilies/6.gif" title=":D" alt=":D"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':P')"><img class="noimg" src="./images/smilies/4.gif" title=":P" alt=":P"></a></td>
</tr>
<tr>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,'X)')"><img class="noimg" src="./images/smilies/12.gif" title="X)" alt="X)"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,'=)')"><img class="noimg" src="./images/smilies/1.gif" title="=)" alt="=)"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':rolleys:')"><img class="noimg" src="./images/smilies/14.gif" title=":rolleys:" alt=":rolleys:"></a></td>
</tr>
<tr>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,';(')"><img class="noimg" src="./images/smilies/3.gif" title=";(" alt=";("></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,';)')"><img class="noimg" src="./images/smilies/13.gif" title=";)" alt=";)"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,'8)')"><img class="noimg" src="./images/smilies/2.gif" title="8)" alt="8)"></a></td>
</tr>
<tr>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':|')"><img class="noimg" src="./images/smilies/5.gif" title=":|" alt=":|"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':O')"><img class="noimg" src="./images/smilies/8.gif" title=":O" alt=":O"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,'8o')"><img class="noimg" src="./images/smilies/9.gif" title="8o" alt="8o"></a></td>
</tr>
<tr>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':]')"><img class="noimg" src="./images/smilies/10.gif" title=":]" alt=":]"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,'?(')"><img class="noimg" src="./images/smilies/5.gif" title="?(" alt="?("></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':(')"><img class="noimg" src="./images/smilies/7.gif" title=":(" alt=":("></a></td>
</tr>
</table>
<?
/* SMILIES EINGABE FORMULAR ENDE */
?>


Wiso nicht, es ist doch alles richtig, oder??
Mfg. BNS

netcup.de Warum gibt es hier Werbung?
Al3x0r Al3x0r am 25.05.06 14:48

wenn überhaupt, dann so

<?php
/* SMILIES EINGABE FORMULAR ANFANG */
$Variable = '
<table width="80" height="160" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" class="tabletitle" align="left">Smilies:</td>
</tr>
<tr>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':)')"><img class="noimg" src="./images/smilies/15.gif" title=":)" alt=":)"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':D')"><img class="noimg" src="./images/smilies/6.gif" title=":D" alt=":D"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':P')"><img class="noimg" src="./images/smilies/4.gif" title=":P" alt=":P"></a></td>
</tr>
<tr>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,'X)')"><img class="noimg" src="./images/smilies/12.gif" title="X)" alt="X)"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,'=)')"><img class="noimg" src="./images/smilies/1.gif" title="=)" alt="=)"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':rolleys:')"><img class="noimg" src="./images/smilies/14.gif" title=":rolleys:" alt=":rolleys:"></a></td>
</tr>
<tr>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,';(')"><img class="noimg" src="./images/smilies/3.gif" title=";(" alt=";("></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,';)')"><img class="noimg" src="./images/smilies/13.gif" title=";)" alt=";)"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,'8)')"><img class="noimg" src="./images/smilies/2.gif" title="8)" alt="8)"></a></td>
</tr>
<tr>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':|')"><img class="noimg" src="./images/smilies/5.gif" title=":|" alt=":|"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':O')"><img class="noimg" src="./images/smilies/8.gif" title=":O" alt=":O"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,'8o')"><img class="noimg" src="./images/smilies/9.gif" title="8o" alt="8o"></a></td>
</tr>
<tr>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':]')"><img class="noimg" src="./images/smilies/10.gif" title=":]" alt=":]"></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,'?(')"><img class="noimg" src="./images/smilies/5.gif" title="?(" alt="?("></a></td>
<td class="tabtd" align="center"><img class="noimg" width="2" height="1" scr="./images/space.gif"><a href="#" onclick="javascript:set(document.form,':(')"><img class="noimg" src="./images/smilies/7.gif" title=":(" alt=":("></a></td>
</tr>
</table>
';/* SMILIES EINGABE FORMULAR ENDE */
?>

BNightSpeeder am 25.05.06 15:17

gut, aber dan muss ich ja überal Backslahes machen, geht das nicht anders??

Johannes am 25.05.06 15:19

Sicherlich. Wäre es nicht viel einfacher den HTML-Inhalt extern in einer Datei zu speichern und dann hinzuzuladen?
[dok]file_get_contents[/dok]

milahu milahu am 25.05.06 15:42

Quote
Original von BNightSpeeder
aber dan muss ich ja überal Backslahes machen

Nur bei den einfachen Anführungszeichen.

Alternativ:
<?php
$foo = <<<EOF
blubbeer
EOF;
?>

BNightSpeeder am 25.05.06 15:47

ich habe die " durch ' ersetzt und dan gehts, thx.

Creative Commons Lizenzvertrag
Alle Inhalte des Webstatt-Archivs stehen unter einer Creative Commons Namensnennung - Weitergabe unter gleichen Bedingungen 3.0 Unported Lizenz.

Impressum & Kontakt