Welcome Guest, Not a member yet? Register   Sign In
Multi-domain architecture

I'm working on a project that is similar to a CMS where I'll have multiple templates all using the same codebase. Each 'client' will be able to load their own information for Name, Address, etc. so I need this information to switch out based on the domain. I'll have a domain field in the database to match against my variable.

I was thinking I would set a domain variable as $_SERVER["HTTP_HOST"] then use some SQL to pull everything based on that. However, I'm just not sure where to put that variable. Use it as a global?

Has anyone done anything similar?

[eluser]Michael Wales[/eluser]
I would just extend the loader class, particularly the view() method. Have that method check $_SERVER['HTTP_HOST'] and query the database for the particular template that domain is using. Then load the appropriate files based on that information.

Theme © iAndrew 2016 - Forum software by © MyBB