Forum Moderators: coopster

Message Too Old, No Replies

How can PHP make site maintenance easier?

What techniques reduce a webmasters workload?

         

steve

3:41 pm on Jun 27, 2007 (gmt 0)

10+ Year Member



I'm in the process of redesigning a static website. To make it easier to update I decided to use php and put the header, footer, etc inside include files.

Today I found a technique, where the file name of the include file is put into a variable, which can then be manipulated by the code.

A little light went on in my head, there must be hundreds of simple tricks like this. What are your favourites?

darrenG

5:04 pm on Jun 27, 2007 (gmt 0)

10+ Year Member



Out of interest, why would you want to manipulate the path of the include file?

jatar_k

5:08 pm on Jun 27, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I have had many sites where I have done this. When you want to have one script set up on any domain then you put the include path in a config file and just include the var

LinkPopularity

5:22 pm on Jun 27, 2007 (gmt 0)

10+ Year Member



what about making your site totally data base driven?

:D

steve

5:53 pm on Jun 27, 2007 (gmt 0)

10+ Year Member



Out of interest, why would you want to manipulate the path of the include file?

To serve a different file depending on the time or day of week, ie ring us we're open vs. sorry we're closed, or presenting content based on where the user came from.

steve

6:01 pm on Jun 27, 2007 (gmt 0)

10+ Year Member



Another idea is to put your navigation in an include file, and use php to highlight (or disable) the link referring to the page you are on.

Thus one nav. menu works for several pages making updating much easier.

hughie

6:09 pm on Jun 27, 2007 (gmt 0)

10+ Year Member



steve, it really depends on how deep into php you want to go, and how good your techie skills are, the sky's the limit really.

I'd look(if you've not already) at how you can bring in your page information (title,header,content) from a database, so that new page creation is simply done by adding a new row in the db.

darrenG

6:51 pm on Jun 27, 2007 (gmt 0)

10+ Year Member



I see what you mean now!

justgowithit

8:25 pm on Jun 27, 2007 (gmt 0)

10+ Year Member



Why stop there? How about a php/mysql CMS?

steve

7:57 am on Jun 28, 2007 (gmt 0)

10+ Year Member



I'd look(if you've not already) at how you can bring in your page information (title,header,content) from a database

This is something I'd be interested in pursuing.

The site in question consists of a 150-200 pages tops. Once a page is added it rarely gets changed or deleted. I'm the only person who works on it, so I don't need a friendly interface for uploading/creating pages etc. Therefore I don't feel it warrants a full CMS.

I've read plenty of 'do anything with php/mysql' books, but haven't found one which covers in detail building a fully database driven site, can anyone offer any titles or on-line tutorials?