Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 04-08-2004, 08:15 PM   #1 (permalink)
ender
Code Monkey
 
ender's Avatar
 
Join Date: Mar 2003
Location: Evansville, IN
Posts: 75
ender is on a distinguished road
Send a message via AIM to ender Send a message via Yahoo to ender
Organization of a Site

Hello,

Although I have been programming for a while (since middle school). I haven't gotten into web programming until recently. However, I haven't gotten into PHP until a few weeks ago. My previous ploys have been with perl. While good, I feel that if I want to be a better pick within the job field should I ever need to get a new job, I should learn how to use this.

So, now that I have wasted precious words on nothing important, here is my real question. How does one go about arranging their numerous script files for a semi-large site? There are a lot of things to think about with this, and I just wondered how other people organized themselves, so I could take hints. Maybe I should just use the same deal as with perl scripts, but the fact that one can include a header and footer makes it a little more complicated. I have authentication/session stuff that needs to go somewhere, and I feel as though I am bungling it up.

Thanks, look forward to your feedback,

Ted Morse
__________________
while(1) fork();
ender is offline   Reply With Quote
Old 04-09-2004, 11:33 PM   #2 (permalink)
xinu
Registered User
 
xinu's Avatar
 
Join Date: Mar 2004
Location: Vancouver, WA
Posts: 7
xinu is on a distinguished road
Send a message via ICQ to xinu Send a message via AIM to xinu Send a message via Yahoo to xinu
development cycle

I posted something similar on LiveJournal's PHP community. There were quite a few replies. Check it out:

http://www.livejournal.com/community/php/132382.html
xinu is offline   Reply With Quote
Old 04-10-2004, 07:10 AM   #3 (permalink)
ender
Code Monkey
 
ender's Avatar
 
Join Date: Mar 2003
Location: Evansville, IN
Posts: 75
ender is on a distinguished road
Send a message via AIM to ender Send a message via Yahoo to ender
Thanks for the input, however, while informative, I don't think that post was quite what I was going for. My question relates to the general layout (files w/ functions in folders) than the development process, even though that is easily read from my post.

Thanks for the interesting link though.

Ted Morse
__________________
while(1) fork();
ender is offline   Reply With Quote
Old 04-10-2004, 08:13 AM   #4 (permalink)
bdl
Senior Contributor
 
Join Date: May 2002
Location: vta.ca.usa
Posts: 555
bdl is on a distinguished road
Depends, I suppose on your personal preferences. To give you an idea of how I arrange things, here's the general layout of a good sized project I've done...and by good sized I mean about 20 scripts.

A directory in the 'root' (the top level 'home' directory) that is in the 'include_path' directive and contain any scripts I wish to include, plus function declarations, and of course the 'classes' directory contains subdirectories with groups of related classes.
Code:
/php_inc
/php_inc/classes
/php_inc/classes/ClassX
The actual directory that's 'live' and available to the public, I've arranged like so:
Code:
projectname/
projectname/images
projectname/adm
So you can see I take a rather simplistic approach, but I try to do things by the KISS principal...keep it simple stupid! The more involved you get with creating separate directories for every little thing, the quicker you lose track, IMHO. Maybe others feel more organized if they create a new directory for each little component of the project...

HTH
bdl is offline   Reply With Quote
Old 04-10-2004, 11:07 AM   #5 (permalink)
xinu
Registered User
 
xinu's Avatar
 
Join Date: Mar 2004
Location: Vancouver, WA
Posts: 7
xinu is on a distinguished road
Send a message via ICQ to xinu Send a message via AIM to xinu Send a message via Yahoo to xinu
Quote:
Originally posted by ender
My question relates to the general layout (files w/ functions in folders) than the development process, even though that is easily read from my post.
I was with you right up until the "if you'd read my question with both eyes, you'd have understood my request, jackass" portion. You'll fit into the developer community just fine - you've already got the RTFM mantra down.
xinu is offline   Reply With Quote
Old 04-10-2004, 01:50 PM   #6 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
wowzers .. heh

well i sorta do what bdl does ..

in my site directory, .. i have an 'include','images','classes' ( if i'm making the site OOP )..

it doesn't seem like one would really need more than that if you are using server-side scripting.

most large sites run off databases in which case the same scripts serves for hundres, or even thousands of pages.

you could make it appear like the end user is looking at a different directory for some content . sorta like how the tutorials section here on codenewbie is:

http://codenewbie.com/tutorials.php

but i use mod-rewrite to make it appear like tutorials is it's own subdirectory and each tutorial is its own html page.

http://codenewbie.com/tutorials/categories/

it make it appear more organized, but i do not really need that subdirectory for the content.
__________________
Mike
sde is offline   Reply With Quote
Old 04-10-2004, 05:01 PM   #7 (permalink)
ender
Code Monkey
 
ender's Avatar
 
Join Date: Mar 2003
Location: Evansville, IN
Posts: 75
ender is on a distinguished road
Send a message via AIM to ender Send a message via Yahoo to ender
xinu,

I did not mean to offend you at all, and I am sorry if I came off harsh or in a 'RTFM' sort of way. I seriously didn't mean to. However, I was trying to steer the thread away from a topic not intended.

Again, I am very sorry if I came off as a jackass, and will try to post more 'polite' responses in the future. Your input is very important and helpful.

Sde, Thanks a lot. I am currently builgin a rather small site for my CS Department Lab Admins, and since this is my first site using PHP, I figured I'd use the paradigm for script storage, function defining, etc. I think I might have solved my problems after actually thinking about them for a minute. But it is nice to know what other people do anyway, in case I come across other instances where something else might be appropriate.

Ted Morse
__________________
while(1) fork();
ender is offline   Reply With Quote
Old 04-10-2004, 05:41 PM   #8 (permalink)
xinu
Registered User
 
xinu's Avatar
 
Join Date: Mar 2004
Location: Vancouver, WA
Posts: 7
xinu is on a distinguished road
Send a message via ICQ to xinu Send a message via AIM to xinu Send a message via Yahoo to xinu
Quote:
Originally posted by ender
I did not mean to offend you at all, and I am sorry if I came off harsh or in a 'RTFM' sort of way.
(after re-reading the original reply)

Your reply looks fine after I've had 2 meals and have been awake 7 hours. You merely tried to shift focus back to site layout and mentioned that it's understandable that your original post might have been vague.

Sorry about that -- uggh.
xinu is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need a code to give freebies on my site zipmagazine HTML, XML, Javascript, AJAX 1 09-22-2004 02:48 AM
Re:Inserting and displaying Unique Statistics from users viewing my site, problem bearslife PHP 3 08-07-2004 07:58 AM
Newbie Site ? DesertWolf Java 2 12-05-2002 12:38 PM


All times are GMT -8. The time now is 10:16 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting