dpnhp20440 2014-07-29 14:26
浏览 36
已采纳

通过URL分隔两个不同的公司

In my php coding, by means of URL, it identifies the company. For example, if company name is comp1 then it's url will be www.comp1.com and for comp2 www.comp2.com

It will automatically put company_id in session by URL.

Problem

Do I need to copy entire code of comp1 to comp2 to establish new company? Is there any way to do this kind of thing? I can not redirect URL. Because it will change URL after redirecting. Database will be same for every companies.

Let me know if you need more information. Thank you.

  • 写回答

2条回答 默认 最新

  • doudao5287 2014-07-29 14:28
    关注

    Point both domains at the same IP. You can use $_SERVER['HTTP_HOST'] to determine which URL was requested and dole out data as needed.

    See Here for more details

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?