Hi
this is what i have added to the top of my index.php file which selects which file to load when a certain domain is in the URL, what i now need is what a certain url is in the address bar to show that specific logo.
switch($_SERVER["HTTP_HOST"])
{
case "domain1.co.uk":
require("domain1.php");
exit();
break;
case "domain2.co.uk":
require("domain2.php");
exit();
break;
}
$url = $_SERVER['SERVER_NAME'];
// or $_SERVER['HTTP_HOST'];
$logo = "default_logo.png";
if ($url == "www.example.com")
{
$logo = "example1.png";
}
elseif ($url == "www.example2.com")
{
$logo = "example2.png";
}
<img src="<?php echo $logo;">">
$logo = "default";
$sub_domain = explode('.', $_SERVER['HTTP_HOST']);
$sub_domain = str_replace("https://", "", $sub_domain); // Remove the https (or http)
if (count($sub_domain) > 2) {
if ($sub_domain[0] == "www") { // if non sub eg (www.maindomain.com)
$sub_domain = "main";
} else {
$sub_domain = $sub_domain[0];
}
$logo = $sub_domain;
}
<img src="<?php echo $logo;?>.png">