Re: Re: Two Sites - One Backend
| From: | Marek Kilimajer | Date: | Tue, 06 Jul 2004 19:53:07 +0000 |
| Subject: | Re: Re: Two Sites - One Backend | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189816@lists.php.net to get a copy of this message | ||
Shaun wrote:
Hi Gerben, Thanks for your reply, the site will be on one server - the idea is that there will be two domain names pointing to the server: http://www.domain_x.com/ and http://www.domain_y.com/. Both of these domains will have a very different interface comprised of header.php, footer.php and a CSS file. However as both domains are pointing to the same site and set of files they will have access to the backend files and database. Is it possible to get the domain name from the browser and then include the relevant file i.e. if(get_url() == http://www.domain_x.com){ include('header_x.php'); } else { include('header_y.php'); } Thanks for your helpUse $_SERVER['HTTP_HOST'] variable, it will contain 'www.domain_x.com' (but can also contain 'domain_x.com', so use substr())