By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,750 Members | 1,471 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,750 IT Pros & Developers. It's quick & easy.

need help: some advices about webroot structure and organization

P: n/a
Hi there!
I'm trying to organize my sources into a webroot tree like this,

webroot
index.htm - only contains index.php into a frame
index.php - require_once('inc/layout.php')

home
page1.php - require_once('../inc/layout.php')
page2.php - require_once('../inc/layout.php')
page3.php - require_once('../inc/layout.php')

inc
config.php
layout.php - require_once('redirect.php')
redirect.php - require_once('config.php')
config.php
contains all the settings... the list of pages and other stuff.

layout.php
is the layout used to draw pages.

redirect.php
contains the functions that I use to browse the site.

I have some questions for yoy:

1. is that a good way to structure the site?

2. what about the require_once function?
I mean is it safe to use relative path?

3.What would be te best strategy to manage this structure?

Thanks in advance for your precious help!
Francesco
Oct 11 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jerry Stuckle wrote:
And you're getting responses in that thread. Please don't post the same
problem in more than one thread.
oh, i'm sorry for that...
>>
My init
>>scripts defines some constants, so it's very easy and convenient to load
files from my different paths.

Do you call init in the index.php page?

I do the same. I just include the script to get system-defined values.
Thanks for your help!
Oct 11 '07 #2

P: n/a
..oO(Francesco)
>Michael Fesser wrote:
>1) Why frames?
What's wrong with frames?
A lot. "Frames are evil" - you can find a lot of stuff about this topic
on Google and in other web authoring newsgroups.

In short: Frames cause a lot of accessibility and usability problems,
but don't provide real benefits. There are some very rare cases where
frames can be useful, but for most "normal" websites they're not.
>What would be the right way?
No frames, just plain pages.
>My init
scripts defines some constants, so it's very easy and convenient to load
files from my different paths.

Do you call init in the index.php page?
It's a bit more complicated here (all page requests are handled by a
single script), but yes, more or less it's like that. On every request
the init script is called/included to setup some important constants for
the other scripts, which will then handle the request.

Micha
Oct 11 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.