473,516 Members | 3,465 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Aug 18 '06 #1
3 1585
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.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

http://www.soccerteamonline.com/?team=teamname

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
Aug 18 '06 #2
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.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.
js*******@attglobal.net
==================
Aug 18 '06 #3
*** 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=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
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
--
Aug 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1966
by: Donald Firesmith | last post by:
We are converting the OPEN Process Framework Repository (www.donald-firesmith.com) of over 1,100 free open source reusable process components for building development methods for software-intensive systems from html to xml. The current html files are organized into a hierarchy of dozens of files based on the natural metamodel of process...
6
1623
by: BigMan | last post by:
I've come to the decision to use multiple namespaces for a very specific reason: I like to use descriptive names of UDTs and I sometimes come up with long UDT names (and file names too, since I name a source file after the UDT that is defined in it, if any). I've also noticed, however, that certain types are related more than logically...
7
3606
by: tgh003 | last post by:
I would be interested to hear how others are managing their javascript (.js) files from the original code vs the obfuscated version they publish to their site/webapp. I currently manage 2 files, and everytime i need to make a change, I have to switch the names, test, then rename again, obfuscate to the original file name (because this is...
10
3229
by: Rada Chirkova | last post by:
Hi, at NC State University, my students and I are working on a project called "self-organizing databases," please see description below. I would like to use an open-source database system for implementation and would really appreciate your opinion on whether PostgreSQL is suitable for the project. In general, I am very impressed by the...
1
4002
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the live databases on the network. Is there a way, via code, when I get back in-house from being on the road to click a button, and select the backends...
0
2007
by: Fredrik Strandberg | last post by:
I am trying to figure out how to organize a visual studio vb.net solution to make it possible to execute automated unit tests. I encounter problems when creating stubs. When testing an existing system, for which I am not allowed to change the structure (projects, namespaces and so on) or the implementation (only correcting faults is...
0
933
by: andrewbb | last post by:
Is there a simple way of organizing the subfolders that flows from development through release? For example, say your end result will be: AppFolder DataFolder TemplateFolder To run that in the development environment DataFolder & TemplateFolder have to be under your "bin" folder. But for them to show up in the Visual Studio project...
5
2812
by: ivarnelispam | last post by:
Hello all, I'm starting work on what is going to become a fairly substantial Python project, and I'm trying to find the best way to organize everything. The project will consist of: - A few applications - Several small scripts and utilities - Unit tests and small interactive test programs - A number of custom libraries and modules that...
2
3969
by: jehugaleahsa | last post by:
Hello: I have a bunch of related items that are either parents, children or not directly related to each other. In my case, I have a bunch of database tables joined with foreign keys. Another example would be a family tree. I would like to take a flat list of these items and build the hierarchy. So, in other words, I would like to take...
0
7273
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7405
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7547
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5106
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
1620
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
487
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.