Re: PHP and HTML (Long)
| From: | Chris Adams | Date: | Thu, 29 Jun 2000 01:44:52 +0000 |
| Subject: | Re: PHP and HTML (Long) | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3709@lists.php.net to get a copy of this message | ||
> yeah, and since when is
>
> <html>
> <font face="verdana"><?=$variable?></font>
> </html>
>
> harder than
>
> print "
>
> <html>
> <font face='verdana'>$variable</font>
> </html>
>
> ";
I agree with your general message, but that's a bad example. Heredoc format doesn't break
JavaScript:
<?
$PageTitle = "Heredoc Example";
$SubHeading = "Testing";
$Message1 = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh
euismod
tincidunt ut laoreet dolore magna aliquam erat volutpat. ";
$Message2 = "Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit
lobortis
nisl ut aliquip ex ea commodo consequat. ";
$Message3 = "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie
consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio
dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla
facilisi.";
print <<<END
<HTML>
<HEAD>
<TITLE>$PageTitle</TITLE>
<BODY>
<H1 STYLE="font-family: Verdana, Arial, Sans-Serif">$PageTitle</H1>
<H2><A HREF="http://www.digitaria.com"
OnClick="window.open('http://www.digitaria.com',
'Digitaria'); alert('Note that this is a JavaScript String inside of an HTML
OnClick'); return
false;">$SubHeading</A></H2>
<P>$Message1</P>
<P>$Message2</P>
<P>$Message3</P>
</BODY>
</HTML>
END
?>