Home Tutorials Fonts Lists Feed RSS Advertising Contact Me

Friday, October 5, 2007

A typical website structure

Save to delicious 0 hits

This is a typical website structure that I use in my web projects. To create this structure using Dreamweaver, select from the menu Windows > Files and add PHP pages and folders.



- index.php file 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 file 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

Sponsored Links
Share this post
Share on Facebook
Share on Twitter
Share on StumbleUpon
Share on Delicious
Share on Reddit
Share on Digg
Share on DesignFloat
Share on Technorati
Feeds RSS Subscribe to Feeds RSS
Old Comments
Alex Mcvitie said...

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 :)

Anonymous said...

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?

Andy said...

shouldn't config.php with passwords be out of the public folders or at least behind a protected folder

zotium said...

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?

Anonymous said...

(@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.

Phil de Somerset said...

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

About Me

I am Antonio Lupetti, Engineer, Pro Blogger, Mac user, Web addicted. Rome, IT.
Feeds RSS Contact Me

SubscribeLatest posts

SubscribeHot Links

Subscribe Design News

Ecoki Eco Green Product Reviews
Apple Reviews and News
CSSRockstars - You Design, We Code. Your PSD to HTML/CSS for just $149