Re: mixing HTML and PHP code

From: Date: Thu, 11 Jan 2001 01:41:43 +0000
Subject: Re: mixing HTML and PHP code
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-33856@lists.php.net to get a copy of this message
uh, while I agree that including your html is definitely the way to go, you _must_ mix php with html to a certain extent, assuming you're actually doing anything interesting like talking to a database. if you're _only_ including files (i.e. using php as a replacement for SSI) I guess that would work. but, so long as the php code is _extremely_ light, and the logic is stored elsewhere, sounds good to me :) definitely avoid print() and echo like the _plague_ for html output. -alex -- Alex Black, Head Monkey enigma@turingstudio.com The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 > From: ivansanchez@wanadoo.es ("MR") > Newsgroups: php.general > Date: 10 Jan 2001 15:46:51 -0800 > Subject: RE: [PHP] mixing HTML and PHP code > > Brian Clark ... >> >> Hello Alexander, >> >> (AW == "Alexander Wagner") wagner@globalpark.de writes: >> >>>> Mmmmppppfff... ultraedit's wordlist file still lacks the color of >>>> allaire's homesite - it does detect which parts of the .php file >>>> are HTML and what parts of the file are PHP code, and colours >>>> syntax very well... >> >> AW> Who needs that? Nesting PHP in HTML is bad style, IMHO. >> >> Bad style?! >> >> You _actually_ print() or echo() everything you want to send to the >> browser? >> >> If it doesn't need to be interpolated by PHP, why print() it? > > Well, sometimes (IMHO), the better way to keep things readable is to include() > things, such as include "page_header.php" , include > "lateral_links.php" , include "page_footer.php" , and so on... > > Damn, my pages look so professional including everything... the final > client-side html page is huge but the main PHP is so simple > and structured... > > And, what i was going to say, if you wanna mix HTML and PHP code, perhaps the > way you want is to include(), print() and echo() all > the HTML and let everything in PHP code... > > Of course, i'm meaning of including() HTML files (without any PHP code). > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#33856) next »