Welcome to WebmasterWorld Guest from 54.167.78.17

Forum Moderators: phranque

Message Too Old, No Replies

Reverse engineer a static stite

To make it partially dynamic

     
7:34 am on Aug 6, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:June 16, 2001
posts:386
votes: 0


Hi,

I have a pure content site which i have kept it purely static deliberately.
However...whenever i want toc hange something sitewide, i will have to modify all the 500+ pages which is time consuming.

Is there was a to use PHP and Mysql and make it partially dynamic? I want the header and footer to be dynamic and the right hand column also to be dynamic.

What i really want to do is...whenever i want to modify the header/footer or right column..i make the changes in one place and a piece of php code inseted in all the templates will parse and display the actual content on all the pages when loaded.

Is it possible to do that? If so what is the best way to achieve that.

Thank you for any help and directions.

Cheers

8:44 am on Aug 6, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:July 24, 2002
posts:1124
votes: 0


ideavirus,

of course that's possible. probably the most important thing to be aware of:

to allow php code in a page to be parsed (carried out), the page needs to be recognised as a php page. this is normally achieved by naming it .php - however, i suspect in your case the endings are .htm. in order not to have to rename all your pages to .php and potentially lose all your SE rankings, you can set your server to "parse html pages as php pages" - search for that phrase in these forums and you'll find lots of info.

otherwise it is simply a matter of searching and replacing your header and footer html code with the appropriate php code. see this post for guidance: [webmasterworld.com...]

once you have started down this road, you will never look back ;)

3:02 pm on Aug 6, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:June 21, 2000
posts:626
votes: 0


Maybe I am over looking things but take a few minutes up front to use server side includes (SSI). The inital setup will be a pain to go through but once done it will help. Want to change the footer? Edit one file and your done.

All my pages are only a block of content. The header, footer, left ahnd side, and right hand side are all includes.

Take care,

Brian

3:50 am on Aug 7, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:June 16, 2001
posts:386
votes: 0


Jaime ... Thank you soo much for the inputs and the directions/pointers. they will be so very helpful. Yes I did think of the issue you emntioned that there should be no need to change the file extensions from .html to .php so that i do not lose the SE indexed pages. I will do the search and use the pointers you gave me.

Brian ... I always wanted to know more about possibly using SSI...can you give me some pointers available either within this forum or sticky me with some external pointers if they cannot be posted in the thread?

Thank you soo much again.
Cheers

5:30 pm on Aug 8, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 8, 2002
posts:150
votes: 0


Another way to do the same which I utilize is to have all your page information and content in a database. I then use a php script and smarty templates (optional) to generate each page and the write to a file as .html

So, I manage all my data dynamically, but publish it static.

5:34 pm on Aug 8, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 21, 2005
posts:2259
votes: 0


>> I always wanted to know more about possibly using SSI

Double check with your host. You may need the file extensions to be renamed to something like shtml. Or... back to the previous suggestion about parsing.

5:40 pm on Aug 8, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 6, 2003
posts:2523
votes: 0


I use php to create includes - and all my older sites with .htm/.html extensions have been modified to parse php through the html extension - works great.