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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
beforedawn
Forum Newbie
Posts: 2
Joined: Mon Jan 05, 2004 12:12 pm

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

Post 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]
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post 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. ;)
beforedawn
Forum Newbie
Posts: 2
Joined: Mon Jan 05, 2004 12:12 pm

Post 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
Post Reply