Page 1 of 1

Newbie: How to insert html into table from an included page

Posted: Mon Jan 05, 2004 12:12 pm
by beforedawn
Hi,

I am building a site in php for the first time.

I have a set template and this is included in every page for the site. However there are two areas within this template that need to be changed for each page.

at the moment I am using including a variable which is defined as the location of the content in the file:

sofor the file index.php...

its $topContent is content/index-top.php

and its $mainContent is content/index-main.php

each bit of content is stored in a different file in the content folder and the actual index.php file is just:

Code: Select all

<?php
$pageTitle = "Florida Family Villas - A Beautiful Villa in a Perfect Location";
$finalTrailItem = "home";
$topContent = "content/index-top.php";
$mainContent = "content/index-main.php";
include 'codeLibrary/include_fns.php';
?>
I don't think this is the best mothod by a long way and I want to be able to use a cms like contribute to update the site. Ideally all the html for a page would be held on that page.

any help would most appreciated. The actual site can be viewed at:
http://www.florida-familyvillas.com

thanks

ash

[Edit: Added PHP tags for eyecandy. --JAM]

Posted: Mon Jan 05, 2004 8:54 pm
by JAM
For a first timer, it looks good. Good work.

But what you are using now (judging from your code snippet), it doesn't sound to bad. A main header, a main bottom and the 'dynamic' content that you put in between.

When you mention CMS, do you mean a database driven solution or...? Feel free to explain more if someone else doesn't have comments. ;)

Posted: Tue Jan 06, 2004 4:12 am
by beforedawn
I would prefer not to use a database for this site as yet but I might do when I start putting photos into it.

What do you think would be the best option?

Aside from a cms i would like to have the the html for each page on the actual page.

so no index-top.php etc, i would like it all contained in the actual page.

Can I put all the html in a database and then use a cms to access it through an admin section? is that the best option? which cms?

thank you so much for you help

ash