[PHP] Block HTML Control
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 QA 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
Re: [PHP] Block HTML Control
On Tuesday 02 September 2003 15:00, 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. ?php if ($doo): ? htmlLots of/html ?php endif; ? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* For every complex problem, there is a solution that is simple, neat, and wrong. -- H. L. Mencken */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
On Tuesday, September 2, 2003, at 12:03 AM, Jason Wong wrote: ?php if ($doo): ? htmlLots of/html ?php endif; ? Awesome. Thanks for the quick reply. Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames There are 10 types of people in this world - those that understand binary and those that don't. --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
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 QA 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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
On Tuesday, September 2, 2003, at 12:06 AM, Seth Willits wrote: ?php if ($doo): ? htmlLots of/html ?php endif; ? Awesome. Thanks for the quick reply. Hmm.. Actually, how does this work with php html? This is actually what I'm trying to do. I should have said this in the first place, sorry :) ?php if ($thisVar) { if ($myVar) { lots; of; php; } else { lots of html } } ? Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames Read the book! Be patient! All success comes from acquiring knowledge and experience. -- Seth Willits --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
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 QA 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
Seth, ?php if ($thisVar) { if ($myVar) { lots; of; php; } else { // End of PHP content ? lots of html ?php // End of HTML content } } ? rgd viraj Seth Willits wrote: On Tuesday, September 2, 2003, at 12:06 AM, Seth Willits wrote: ?php if ($doo): ? htmlLots of/html ?php endif; ? Awesome. Thanks for the quick reply. Hmm.. Actually, how does this work with php html? This is actually what I'm trying to do. I should have said this in the first place, sorry :) ?php if ($thisVar) { if ($myVar) { lots; of; php; } else { lots of html } } ? Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames Read the book! Be patient! All success comes from acquiring knowledge and experience. -- Seth Willits --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
On Tuesday, September 2, 2003, at 02:06 AM, Viraj Kalinga Abayarathna wrote: Seth, ?php if ($thisVar) { if ($myVar) { lots; of; php; } else { // End of PHP content ? lots of html ?php // End of HTML content } } ? Aaa ok. I was confused with the semi colon and colon used in the last example. This clears it all up. Thanks. Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames Dreams are what reality is made of. -- Seth Willits --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
Seth Willits wrote: Aaa ok. I was confused with the semi colon and colon used in the last example. This clears it all up. Thanks. http://us3.php.net/manual/en/control-structures.alternative-syntax.php -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
You do realize that you don't need a semicolon right after ?php tags, correct? -Dan On Tue, 2003-09-02 at 04:59, Viraj Kalinga Abayarathna wrote: 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 QA 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
you mean after ?php and ? ??? no you do not put. just think this way, if you want to diplay the HTML content just jump out by the php code by typing ? and back to PHP by ?php when your done. rgd Viraj Dan Anderson wrote: You do realize that you don't need a semicolon right after ?php tags, correct? -Dan On Tue, 2003-09-02 at 04:59, Viraj Kalinga Abayarathna wrote: 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 QA 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php