Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

188
Visualizações
How to create website folder above root directory of admin in PHP

I've tried to figure out the best way to create a website programmatically in PHP but I couldn't find any similar questions here or elsewhere. The situation is this: I have an admin dashboard and a DB connected to this admin dashboard. In this dashboard I create a website with all the necessary settings. Like list of foods and images and colors etc. When I save a website in the dashboard I need to create a website folder above the root directory of the admin panel on my web server. So it creates all the files and folders which will be uploaded to that folder and be connected to the admin DB to get the data. The thing is that I want to create dozens of websites with the same structure but with different data and colors etc., not as subdomains of the admin dashboard but as a main domain. Of course the domains will be created manually in my c-panel. It's not about the coding but about the approach to this problem. Would be happy about any suggestions.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

If the websites are all sharing the same code base, but just have different data, I would consider not creating different folders at all. Store all of your data for each site in the database.

You can then create a single virtual host in Apache set as the default that will handle all requests that do not explicitly match another. Your PHP code can then look at the Host header to determine which site is being accessed, query the database to determine if it is valid and load the data, and then serve the appropriate content.

I would not advise dynamically altering system configuration with PHP. Though it could be done safely, this seems overly complex and prone to errors that could be significant security risks.

Obviously, there are many approaches to this and ultimately the correct one will depend on your use case and the customization and uniqueness of each site.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda