Re: Executing a string with both html and php inside it..

From: Date: Thu, 15 Mar 2001 16:06:12 +0000
Subject: Re: Executing a string with both html and php inside it..
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-44048@lists.php.net to get a copy of this message
On Wednesday 14 March 2001 16:26, you wrote: > Hey! > > I would like to thank you and Mark for your quick reply. > > What am I trying to accomplish is the following: > > I have created an engine which separates my website's code and > design. The code is stored in one file(code.txt) and the design in > another(design.txt). [...] > Now, after I've told you all the things you should know, I ask for your > assistance. > What do you suggest me to do? I'd say use another approach. Separating code and design is good, but keeping each on only one file will cause more troubles that it's worth. I keep all my design in one directory, as several files, each a snippet of HTML (usually with some <?= $SomeVar ?> statements embedded): misc_hitcounter_g.html misc_hitcounter_s.html page_footer-titel.html page_footer.html page_header-titel.html page_header.html page_toc-linkmarked.html page_toc-linkstd.html page_toc.html mail_subscribe-failure.html mail_unsubscribe-failure.html mail_subscribe-success.html mail_unsubscribe-success.html news_item-std.html news_item-std.html for example looks like this (it's a german site): <tr valign="top"> <td colspan="2" height="2"><img src="/images/transparent.gif" width="1" height="1"></td> </tr> <tr valign="top"> <td> <p class="bb"><?= $PTime ?></p> </td> <td> <p class="bb"><?= $Title ?></p> </td> </tr> <tr valign="top"> <?php if ($Usermode == 'maint') { ?> <td><a href='/maintain.php?what=news&amp;id=<?= $ID ?>&amp;action=edit' class='inbody'>Bearbeiten</a></td> <?php } else { ?> <td>&nbsp;</td> <?php } ?> <td><?= $Body ?></td> </tr> Such an approach is IMHO easy to understand and handle, well-structured etc. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Pretty cool, the kind of power information technology puts in our hands these days. - Securityfocus on probing 36000000 hosts for known problems in 3 weeks

« previous php.general (#44048) next »