Re: Block HTML Control
| From: | Viraj Kalinga Abayarathna | Date: | Tue, 02 Sep 2003 08:59:11 +0000 |
| Subject: | Re: Block HTML Control | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161432@lists.php.net to get a copy of this message | ||
Seth,
try to mingle PHP and HTML.. that means escape the PHP and jump to HTML
when
you want the HTML.. like this...
<?php
if (!$var) {
?> <lots>
<of>
<html>
<?php
;
} else {
?> <lots>
<of>
<html>
<?php ;
}
?>
happy coding
Viraj
Seth Willits wrote:
>
> I'd like to show a big chunk of HTML if a particular variable is true,
> and if its false I'd like to show a different big chunk of html. Right
> now the only way I know of doing this is:
>
> if ($var) {
> print '
> <lots>
> <of>
> <html>
> ';
> } else {
> print '
> <lots>
> <of>
> <html>
> ';
> }
>
> This works, but it destroys the syntax coloring of the html making it
> all one solid color. I'd love to know if there's a better way OTHER
> than include()ing different files.
>
> Seth Willits
> ------------------------------------------------------------------------
> ---
> President and Head Developer of Freak Software - http://www.freaksw.comõ_Ør®
> -Àu·¾€~F0
> Q&A Columnist for REALbasic Developer Magazine -
> http://www.rbdeveloper.com
> Webmaster for REALbasic Game Central -
> http://www.freaksw.com/rbgames
>
> "Knowledge is limited. Imagination encircles the world."
> -- Albert Einstein
> ------------------------------------------------------------------------
> ---
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php