just a question about directory structure

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Castles
Forum Newbie
Posts: 14
Joined: Tue Nov 04, 2003 10:21 am

just a question about directory structure

Post by Castles »

Hey everyone, I'm making a site in php and I was wondering what the best way to lay out the site is... should I have a html folder for html bits and an include folder for included scripts.. and a class folder for the classes? Or should I just keep it all flat? mainly, I'm just wondering what everyone else does.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I separate things out so that I know where they should be - images in an images folder, pdfs in a pdf folder, class and function files in their own folder... but it'll depend on what makes sense to you and how big your site is as to how complex a folder structure you want.

Mac
User avatar
uberpolak
Forum Contributor
Posts: 261
Joined: Thu Jan 02, 2003 10:37 am
Location: Next to the bar

Post by uberpolak »

When I start a new site, I create at least one images folder. If I'll be using multiple kinds of images heavily, I'll create separate image folders based on type (e.g. a graphics folder and a photos folder). The way I approach most sites is I'll have the different layouts in the root directory, and the content in page directories, depending on what kind of content. I also have a directory for style-related files.

For example:

Code: Select all

Root: index.php, printer.php, etc.
Graphics: header.jpg, background.gif, logo.png, etc.
Pages: home.php, services.php, contact.php, etc.
Styles: default.css, printer.css, menudrop.js, etc.
Post Reply