Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Best way to create php template?
Old 12-05-2003, 11:55 AM Best way to create php template?
Super Talker

Posts: 108
Trades: 0
I've tried approaching a php based template multiple ways, but it never seems very efficient to me. And I don't want to use page id's, to make the pages more google and user friendly. So I was thinking of doing this:

<?php

$title = "My site - the test page";
$keys = "site, test, page, testing, template";
$desc = "This is the template test page.";
$head = "Test Page";
$date = "December 5, 2003";
$author = "SagaLore";

include ("master.php");

?>

The master.php file would then load the template - CSS, header, footer, menu, and the body. The above code would be an index.php file within a dedicated folder. And then another body.htm file would be in the folder that is loaded by default, plus all the images and whatever other objects I might reference. This way for every page I have, I actually have a folder.

So I was thinking, that's a pretty cool way to do it. But then I was thinking of a way to make menu generation easier. So I was looking at some directory listing scripts... I think there is a way for me to list just the folders, and exclude any folders that start with an underscore (marked as a work in progress). That way I can let that menu script do it's thing instead of having to manually update it all the time. But then I was thinking, if my site got a lot of hits, that would be some major processing time, wouldn't it? Is there an easier way? Maybe I shouldn't be so lazy?
__________________

Please login or register to view this content. Registration is FREE
SagaLore is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-06-2003, 02:13 AM
Experienced Talker

Posts: 31
Location: Redondo Beach, CA
Trades: 0
You can set apache to execute a particular script anytime a request is made to a particular directory.
for instance www.domain/script causes apache to execute a file named 'script', but so does www.domain/script/whatever and so does www.domain/script/whatever/somethingelse

'script' then reads and parses the request and decides what file to include based on what comes after the www.domain/script

The thing in httpd.conf - or whatever your apache conf file is called looks like

<Location /script>
ForceType application/x-httpd-php
</Location>

Or you can include a standard header and footer in each file.

Or you can do what you are thinking. It just seems a little strange organizationally. I don't think traffic would cause a problem with processing time as it is pretty infinitesimal. I don't know about the filesystem though if you end up having 10,000 directories or something like that.
__________________
Myrealtypage - Real Estate Web Design
myrealtypage is offline
Reply With Quote
View Public Profile Visit myrealtypage's homepage!
 
Reply     « Reply to Best way to create php template?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24945 seconds with 12 queries