tags:

views:

31

answers:

3

I am putting my php /mysql website up and this is my scenario The users are grouped into sites each site with their own unique database. There will be about 40 users per site. the two options I'm trying to decide between are

  1. have a central website running the php and directing the users off to their own database

  2. using sub domains for each user each with their own php in htdocs

I dont even know if 2 is possible/stupid but if it was, would it make any difference to performance as they're all being run by the same server. Any other ideas/ advice much appreciated as I want to organise it the best way from the start

+1  A: 

1 would definitely be the right idea, you only have one copy of the code to worry about and you don't waste disk space on extra copies of the same code.

Charlie Somerville
thanks, so would it be possible to have subdomains with one copy of the code as although it would be hard to set up it would allow a customised login page
bsandrabr
You can run Apache without VirtualHosts setup for those subdomains and the subdomain will be in $_SERVER['SERVER_NAME']
Charlie Somerville
A: 

At login, you won't know where to direct them as they haven't identified themselves yet. After login, you can easily customise it for them.

You could create two separate PHP login files, and give different links to each set of users, but a simple clean login page and then a customised front end after login seems the best way.

Psychic
A: 

You could use 1 with wildcard subdomains and use .htaccess to change the subdomain into a posted parameter. That way you get one copy of the script and subdomains all in one go.

One thought, why dont you use a single database with an extra 'accounts' table, this may simplify things!

Sqoo