HTTP
|
|
|
|
<?php
function grab_domain()
{
global $HTTP_HOST;
$str = $HTTP_HOST;
$str = trim($str);
$str = strtolower($str);
$str = str_replace("www." , "", "$str");
return "$str";
}
?>
|
|
|
Usage Example
|
<?php
$domain = grab_domain();
if ($domain == "domain1.com") {
include"page_defs_domain1.inc";
}
if ($domain == "domain2.com") {
include"page_defs_domain2.inc";
}
?>
You can get as creative as you like,
in my case I wrote a switch statement
that called the correct page definition
include file for each domain.
|
|
|
Rate This Script
|
|
|
|