Re: Block HTML Control

From: Date: Tue, 02 Sep 2003 01:23:57 +0000
Subject: Re: Block HTML Control
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-161426@lists.php.net to get a copy of this message
you can try if( $var) require("1.html"); else require("2.html"); 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 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
------------------------------------------------------------------------ ---
-- Raditha Dissanayake http://www.radinks.com/sftp/?sg Lean and mean secure FTP applet in pure java. Complete with Graphical User Inteface Just 150 kb in size.

« previous php.general (#161426) next »