<?
include("../mainfile.php");
$tmp = getenv("HTTP_HOST");
list($subDomain,$web) = explode(".",$tmp,2);
$myDomain = "." . $web;
if ($myDomain != $config[url_mapping_domain]) {
echo "Incorrect URL!!";
exit;
}
$result = mysql_query("select URL from ps_domain where domain='$subDomain'");
list($URL) = mysql_fetch_row($result);
mysql_free_result($result);
if ($URL != "") {
?>
<html>
<head>
<title>Welcome!</title>
</head>
<frameset rows="0,*" framespacing="0" border="0" frameborder="0">
<frame name="header" scrolling="no" noresize target="main" src="header.php">
<frame name="main" src="<?=$URL?>">
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
<?
} else {
?>
<html>
<head>
<title>Wrong URL</title>
</head>
<body>
<p>Incorrect URL!!</p>
</body>
</html>
<?
}