organizing code and folder structure

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,

I 'm building a website that provide services for soccer teams. When a
user (team) signs up I want to give him some personal space like where
is my registered domain and teamname is the name chosen by the user. I
want to have one singel code base meaning that I don't want to copy my
code to every new account. Can someone please give me some advice on
how to achieve this since I really don't have an idea on how to do

Thanks in advance

Re: organizing code and folder structure

You need to be a bit clearer about what you are trying to achieve here;
Does each team sub-domain contain the same details (e.g. players,
contact details, forms to input scores, pages to see results of
previous matches etc...)

If so there is no need to generate a whole series of pages for each
team.  Each page can use a template and drag the relevant data from a
database (PHP and MySQL are perfect for this)  You just need to be able
to identify the team that the page is being generated for.

If on your main page you are going to list all of the teams and allow
the user to select one with a hyper-link then you can use HTTP_GET_VARS
to drag parameters from the URL.

See my site for an example of how this works:-

The League tables builds a HREF URL in php, to ../PlayerResults.php
with two parameters on the end (the bit after the '?') These parameters
show the record ids in the database for the player and the event.

In the receiving page, these are extracted using HTTP_GET_VARS and then
used to generate the relevant data from the database for ONLY that
Player and that Venue.  One php file = 80+ different page displays
depending on the selection made.

In this instance your team specific page URL would be

If you wanted then you would
need to create a single page for each team that did a redirect to .  If you were really
cute you could get PHP to write the page for you when the team was

If you are going to allow them to select a team from a drop down list
then you would use form method =POST and $_POST[] to retrieve the form

If you have no idea what I'm talking about, then maybe you need to
start smaller and learn a little more about how PHP works and what it
can and can't do


Tarscher wrote:
Quoted text here. Click to load it

Re: organizing code and folder structure

Tarscher wrote:
Quoted text here. Click to load it

Three ways I can think of off hand:

   Files in each directory which just include the "real" code files
   Apache redirects (ask in alt.apache.configuration)
   Symlinks (Linux) or Virtual Directories (Windows) (ask your sysadmin)

Probably a dozen other ways, but these three come to mind first.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: organizing code and folder structure

*** Tarscher escribió/wrote (18 Aug 2006 00:36:05 -0700):
Quoted text here. Click to load it

Such things are usually accomplished using Apache's mod_rewrite (if your
web server _is_ Apache, of course). It works like this:

User asks for /teamname/ -> Server calls /foo.php?team=teamname
User asks for /teamname/bar -> Server calls /bar.php?team=teamname

Google for "mod_rewrite cheat sheet", it *is* confusing if you're new to

-+ - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web:
+- Mi web de humor con rayos UVA:

Site Timeline