Webstatt.org - Community seit 2006 - 2012 (2024?)

Variable und HTML-CODE

user-137
25.05.2006 12: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,'lächeln'zwinkern"><img class="noimg" src="./images/smilies/15.gif" title="lächeln" alt="lächeln"></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,'Fettes Grinsen'zwinkern"><img class="noimg" src="./images/smilies/6.gif" title="Fettes Grinsen" alt="Fettes Grinsen"></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,'frech'zwinkern"><img class="noimg" src="./images/smilies/4.gif" title="frech" alt="frech"></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)'zwinkern"><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,'=)'zwinkern"><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:'zwinkern"><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,';('zwinkern"><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,'zwinkern'zwinkern"><img class="noimg" src="./images/smilies/13.gif" title="zwinkern" alt="zwinkern"></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)'zwinkern"><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,'neutral'zwinkern"><img class="noimg" src="./images/smilies/5.gif" title="neutral" alt="neutral"></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'zwinkern"><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'zwinkern"><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,':]'zwinkern"><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,'?('zwinkern"><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,'traurig'zwinkern"><img class="noimg" src="./images/smilies/7.gif" title="traurig" alt="traurig"></a></td>
</tr>
</table>
<?
/* SMILIES EINGABE FORMULAR ENDE */
?>


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

Avatar user-118
25.05.2006 12: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,'lächeln'zwinkern"><img class="noimg" src="./images/smilies/15.gif" title="lächeln" alt="lächeln"></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,'Fettes Grinsen'zwinkern"><img class="noimg" src="./images/smilies/6.gif" title="Fettes Grinsen" alt="Fettes Grinsen"></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,'frech'zwinkern"><img class="noimg" src="./images/smilies/4.gif" title="frech" alt="frech"></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)'zwinkern"><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,'=)'zwinkern"><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:'zwinkern"><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,';('zwinkern"><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,'zwinkern'zwinkern"><img class="noimg" src="./images/smilies/13.gif" title="zwinkern" alt="zwinkern"></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)'zwinkern"><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,'neutral'zwinkern"><img class="noimg" src="./images/smilies/5.gif" title="neutral" alt="neutral"></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'zwinkern"><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'zwinkern"><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,':]'zwinkern"><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,'?('zwinkern"><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,'traurig'zwinkern"><img class="noimg" src="./images/smilies/7.gif" title="traurig" alt="traurig"></a></td>
</tr>
</table>
';/* SMILIES EINGABE FORMULAR ENDE */
?>

Ich brauche keine Signatur
user-137
25.05.2006 13:17

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

user-203
25.05.2006 13: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]

Denkt dran, Kinder auf dem Rücksitz verursachen Unfälle, Unfälle auf dem Rücksitz verursachen Kinder.
Avatar user-255
25.05.2006 13:42

Original von user-137
aber dan muss ich ja überal Backslahes machen

Nur bei den einfachen Anführungszeichen.

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

Those who can, do. Those who can't, teach. # Musik gehört dem Volk! # last.fm
user-137
25.05.2006 13:47

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