RE: [PHP] What is the best way to do this...
Personally I would look at a templating system, there are lots of them around. I have only used FastTemplates and Smarty I would reccommend the later. http://www.phpinsider.com/php/code/Smarty/ or have a look at for a few more: http://phpclasses.upperdesign.com/browse.html/class/1 Hope this helps, Joseph -Original Message- From: DeloX [mailto:[EMAIL PROTECTED]] Sent: Friday, 26 October 2001 4:49 PM To: [EMAIL PROTECTED] Subject: [PHP] What is the best way to do this... Let s say i have 5 pages on my site. I want some content to appear on each page so that when i want to change that content on all the pages i have only one place to modify. I used to write that content in a .txt file and having it read each time any of the 5 pages was loaded. So i had to modify the code only in the .txt file. It was working good but the code in the .txt file could not be PHP because it would not be processed when loaded by the other pages. There s probably a better way of doing it. Like a page can probably include another page that itself include another one. Any help would be great Thx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] What is the best way to do this...
From: DeloX <[EMAIL PROTECTED]> Date: Fri, Oct 26, 2001 at 03:18:33AM -0400 Message-ID: <[EMAIL PROTECTED]> Subject: [PHP] What is the best way to do this... > Let s say i have 5 pages on my site. I want some content to appear on each > page so that when i want to change that content on all the pages i have only > one place to modify. I used to write that content in a .txt file and having > it read each time any of the 5 pages was loaded. So i had to modify the code > only in the .txt file. It was working good but the code in the .txt file > could not be PHP because it would not be processed when loaded by the other > pages. There s probably a better way of doing it. Like a page can probably > include another page that itself include another one. > > Any help would be great > Thx You can use a , depending on the layout of your page. Or you can use some templating stuff (check the archives, these have been discussed several times). But you can also take a look in reversing what you're doing. I mean; instead of trying to get the changing part out, you can also get the 'static' part out of you page. Then you can use that by calling require[_once] ("header.php") or something like that. Or you could use the auto_prepend and auto_append. -- * R&zE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] What is the best way to do this...
On Fri, 26 Oct 2001 16:48, DeloX wrote: > Let s say i have 5 pages on my site. I want some content to appear on > each page so that when i want to change that content on all the pages i > have only one place to modify. I used to write that content in a .txt > file and having it read each time any of the 5 pages was loaded. So i > had to modify the code only in the .txt file. It was working good but > the code in the .txt file could not be PHP because it would not be > processed when loaded by the other pages. There s probably a better way > of doing it. Like a page can probably include another page that itself > include another one. > > Any help would be great > Thx You'll find in the docs about include/require that when a file is included, the parser drops back to 'text' mode; if you want the contents of an included file parsed you need to put tags in the file. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Funny off-topic messages are always on-topic. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]