This is a typical website structure that I use in my web projects. To create this structure using Dreamweaver, select from the menu the option Windows > Files and start creating new pages and folders.
- index.php is the "container" of your site. Inside this page we will define the page's principal sections (topbar, navigation's bar, main content, footer);
- config.php contains the connection's strings for MySQL database (host name, user, password);
- image folder contains all the graphical elements for your site (gif, jpeg, png);
- css folder contains the style sheets files (.css);
- include folder contains all the web pages that will be loaded into the index.php "main content" section using URL variables.
See also: Load pages using URL variables and PHP include() function
Friday, October 5, 2007
A typical website structure
by Antonio Lupetti Tag
html

This is awesome, exactly what i have been looking for, im just begining to learn php and this is a great tutorial, please do more :)
I'm learning to build a website. If you do this, the title tag will be the same for all pages in the website? If you use a GET in index.html, how does a form/POST work in the content in one of the pages?
shouldn't config.php with passwords be out of the public folders or at least behind a protected folder
Hey Antonio,
The problem is, when editing the include files if they have images that reside in the /images folder, you wouldn't be able to see the images.
How do you work around this problem?
(@zotium: you will as long as you use absolute paths instead of relative.)
This is exactly how I organize my website but two things though:
1)I put my config file inside the "includes" folder and protect this folder and all it contains with an .htaccess file.
2)To organize your site the way you suggest, there's more to do about security. You should make sure that the user can only access the included files within the index one and redirect him to the root in any other case.
Hi,
Slightly off topic, but could you tell me what software you used to create the site diagram in this post?
Your tutorials are very good by the way.
Thanks
Phil