Forum Moderators: coopster

Message Too Old, No Replies

Creating a template system

         

techexplorer

3:17 pm on Nov 21, 2008 (gmt 0)

10+ Year Member



I don't know if this is the right place to post this or not, but I'll give it a go. I am new to php, most of my experience is in html and css.

That said. What I am wanting to do is possibly use php to manage info boxes across all pages of my site. For example, on my main page I have a sidebar with content that gets updated frequently. This sidebar will display on all pages. I don't want to have to go and edit each pages sidebar. If you could point me in the right direction (online resources, etc.) for learning how to use php to "plug in" html files into certain DIVs on a page that would be great! Thanks, and again sorry if this is the wrong place to post.

PHP_Chimp

6:46 pm on Nov 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You want to look at the include [us2.php.net] or require functions.
As you can then echo the html you want and "include" it where you want.

techexplorer

9:50 pm on Nov 21, 2008 (gmt 0)

10+ Year Member



I really appreciate that information! Helped me out tremendously!

Pico_Train

12:57 pm on Nov 22, 2008 (gmt 0)

10+ Year Member



I believe that include, if it fails allows everything to carry on as is without throwing a fatal error.

If require fails it throws a fatal error.

So if you are using these for headers, nav, footers, etc.. use include.

Cheers.

vincevincevince

1:15 pm on Nov 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could try the one line template engine [webmasterworld.com]