Concept of a Saas virtual store system

Asked

Viewed 68 times

-2

Good evening, I developed a system that behaves in the formed Saas, where the client only register 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, IE, everyone uses www.lalalaetc.com.br/app and the system separates everything by unique identifier, however, I would like to develop a virtual store from it, only there would be a difference, the domain, ie, I believe that the principle is the same, use a unique identifier for each store, but my doubt is how do I make so that when someone access the store the domain is correctly directed and load the id of my client? Which way to go and what I need to research to do such a feat?

  • *click reopen unintentionally.

1 answer

0


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

Here comes the way your application has been developed. If you treat the current company in all areas of the system and have no standards that allow you to execute a code before the application startup (such as Frontcontroller, you can create a class that you can use whenever you want to check the domain, if you have it, just put it in this location and everything will work smoothly.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.