<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body alink="#ee0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
vlink="#551a8b">
Lennart Sorensen wrote:
<blockquote cite="mid20061110142157.GH8237-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys@public.gmane.org"
type="cite">
<pre wrap="">On Fri, Nov 10, 2006 at 09:16:38AM -0500, Lennart Sorensen wrote:
</pre>
<blockquote type="cite">
<pre wrap="">You can simply jump in and out of code mode from html (the default mode)
at any time with the <?php / ?> tags. I didn't actually run any of
these examples, but php code is almost never wrong... :)
</pre>
</blockquote>
<pre wrap=""><!---->
Something else handy in php that may not be obvious that you can do is:
<?
$state = 1;
?>
<HTML>
<TITLE>Some page</TITLE>
<BODY>
<? if($state) { ?>
This is the content of my page.
<? } else { ?>
This is the alternate content of my page
<? } ?>
</BODY>
</HTML>
--
Len Sorensen
--
The Toronto Linux Users Group. Meetings: <a class="moz-txt-link-freetext" href="http://gtalug.org/">http://gtalug.org/</a>
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: <a class="moz-txt-link-freetext" href="http://gtalug.org/wiki/Mailing_lists">http://gtalug.org/wiki/Mailing_lists</a>
</pre>
</blockquote>
Just a minor thing, but the above could also be written as: <br>
<pre wrap=""><?
$state = 1;
?>
<HTML>
<TITLE>Some page</TITLE>
<BODY>
<? if($state): ?>
This is the content of my page.
<? else: ?>
This is the alternate content of my page
<? endif; ?>
</BODY>
IMHO it makes the HTML/PHP mix a bit easier to read as you're not following brackets, especially if you have several levels in indentation.
Zoltan Hunt
<a class="moz-txt-link-abbreviated" href="http://www.YYZtech.ca">www.YYZtech.ca</a> - Cybercafe reviews and more
</pre>
<br>
</body>
</html>
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists