organizing code and folder structure

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tarscher

    organizing code and folder structure

    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
    http://www.soccerteamonline.com/teamname where www.soccerteamonline.com
    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
    this.

    Thanks in advance
    Stijn

  • frothpoker

    #2
    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 www.frothpoker.co.uk for an example of how this works:-

    The League tables builds a HREF URL in php, to ../PlayerResults.p hp
    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 http://www.soccerteamonline.com/teamname then you would
    need to create a single page for each team that did a redirect to
    http://www.soccerteamonline.com/?team=teamname. If you were really
    cute you could get PHP to write the page for you when the team was
    created.

    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
    details.

    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

    Obiron.


    Tarscher wrote:
    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
    http://www.soccerteamonline.com/teamname where www.soccerteamonline.com
    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
    this.
    >
    Thanks in advance
    Stijn

    Comment

    • Jerry Stuckle

      #3
      Re: organizing code and folder structure

      Tarscher wrote:
      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
      http://www.soccerteamonline.com/teamname where www.soccerteamonline.com
      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
      this.
      >
      Thanks in advance
      Stijn
      >
      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.conf iguration)
      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.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • Alvaro G. Vicario

        #4
        Re: organizing code and folder structure

        *** Tarscher escribió/wrote (18 Aug 2006 00:36:05 -0700):
        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
        http://www.soccerteamonline.com/teamname where www.soccerteamonline.com
        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
        this.
        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=te amname
        User asks for /teamname/bar -Server calls /bar.php?team=te amname

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

        --
        -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
        ++ Mi sitio sobre programación web: http://bits.demogracia.com
        +- Mi web de humor con rayos UVA: http://www.demogracia.com
        --

        Comment

        Working...