Re: Auto-generating HTML
| From: | tedd | Date: | Tue, 21 Sep 2010 18:18:31 +0000 |
| Subject: | Re: Auto-generating HTML | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-308247@lists.php.net to get a copy of this message | ||
At 2:56 PM -0400 9/20/10, Andy McKenzie wrote:
Hey folks, I have the feeling this is a stupid question, but I can't even find anything about it. Maybe I'm just not searching for the right things. Here's the problem. I'm writing a lot of pages, and I hate going in and out of PHP. At the same time, I want my HTML to be legible. When you look at it, that's kind of a problem, though... for instance-snip- You can mix html and php more effectively and with better clarity than that. Two things you should consider: 1. Effective use of includes. Please review and learn from this demo: http://sperling.com/examples/include-demo/ 2. Isolated use of echo()'s. I only mix html and php when it is necessary to inject values created by a php/mysql process. To show these values I typically use this format: <?php echo($whatever); ?> within html -- for example: <h1><?php echo($title);?></h1> As such, all my code (html, css, php, mysql, javascript) is not complex, nor unreadable, and is easily maintainable. Cheers, tedd -- ------- http://sperling.com/