471,887 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

need help: some advices about webroot structure and organization

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

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

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

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

is the layout used to draw pages.

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!
Oct 11 '07 #1
2 2188
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
>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.

Oct 11 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by The_Kingpin | last post: by
12 posts views Thread by Francois Soucy | last post: by
6 posts views Thread by encoad | last post: by
4 posts views Thread by John Smith | last post: by
1 post views Thread by murdla | last post: by
18 posts views Thread by CenturionX | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.