473,651 Members | 2,644 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 1593
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

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.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.
js*******@attgl obal.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=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
--
Aug 18 '06 #4

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

Similar topics

1
1984
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 components on which the framework is based. I have the following questions: 1) What is the...
6
1630
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 but also lexically - they start with the same word (which happens to be the basic concept that they...
7
3611
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 the file referenced in php/perl/asp whatever files). So its kind of a pain. Any thoughts out...
10
3242
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 quality of PostgreSQL code and documentation, as well as by the support of the developer community. ...
1
4007
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 I want to link to? I would want to delete all the current links and link to the "live"
0
2012
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 allowed), I have the following situation: -Project "Handlers" -Class "Rodscanner"
0
943
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 (and included in SourceSafe), those folders must
5
2816
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 may be shared and
2
3977
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 one element and figure out its relationship to the other items. When I am all done, I
0
8349
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8795
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8460
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7296
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6157
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
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
2
1585
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.