Concept of a SaaS virtual store system [closed]

-2

Good evening, I developed a system that behaves in the SaaS format, where the client only registers and already has access to use, in it I used a unique identifier for each client and they all use the same structure, PHP files and the Same database. So far so good, because the domain does not change, that is, everyone uses www.lalalaetc.com.br/app and the system separates everything by the unique identifier, however, I would like to develop a virtual store from it, only there would be a difference, the domain, that is, I believe the principle is the same, use a unique identifier for each store, but my doubt is how I will make it so that when someone accesses the store the domain is addressed correctly and load the id of my client? What is the way forward and what do I need to research to do such a feat?

    
asked by anonymous 23.11.2017 / 00:21

1 answer

0

Using the $_SERVER['SERVER_NAME'] variable will get the domain that was accessed. So with this information you can get the company you want.

Here comes the way your application was developed. If you treat the current company in all areas of the system and do not have defaults that allow you to run a code before starting the application (such as #

    
23.11.2017 / 03:32