geoff777 Posted May 4, 2010 Share Posted May 4, 2010 Hi I have a few related domains all pointing at the root folder. I need to change the logo for the appropriate site. So I have set up multiple CSS files. I need to check the Server Name and load the correct CSS file ... anyone know how to do this? I have this ... variable(array('name' => 'server_name', 'value' => strtolower($_SERVER['SERVER_NAME']))); I don't know how to construct the conditional statement as I get www.mydomain.com and mydomain.com returned also how do I include the CSS files Thanks Geoff Link to comment https://forums.phpfreaks.com/topic/200701-multiple-domains-change-logo-_serverserver_name/ Share on other sites More sharing options...
geoff777 Posted May 4, 2010 Author Share Posted May 4, 2010 After a search I found this from another thread. I've inserted the domains that I'm using. I'm not sure if it is correct or how to call the function ... function get_css($baselink='../css/',$hostname=NULL) { $hostname = $hostname === NULL ? $_SERVER['SERVER_NAME'] : $hostname; switch($hostname) { case "www.the-rock-of-gibraltar.com": case "the-rock-of-gibraltar.com": $css_file = "gibraltar_logo.css"; break; case "www.torremolinos-benalmadena.com": case "torremolinos-benalmadena.com": $css_file = "torremolinos_logo.css"; break; case "www.fuengirola-mijas.com": case "fuengirola-mijas.com": $css_file = "fuengirola_logo.css"; break; case "www.marbella-puerto-banus.com": case "marbella-puerto-banus.com": $css_file = "marbella_logo.css"; break; case "www.estepona-san-pedro.com": case "estepona-san-pedro.com": $css_file = "estepona_logo.css"; break; case "www.manilva-sabinillas.com": case "manilva-sabinillas.com": $css_file = "manilva_logo.css"; break; case "www.puerto-de-la-duquesa.com": case "puerto-de-la-duquesa.com": $css_file = "duquesa_logo.css"; break; case "www.sotogrande-guadiaro.com": case "sotogrande-guadiaro.com": $css_file = "sotogrande_logo.css"; break; case "www.puerto-de-la-duquesa.com": case "puerto-de-la-duquesa.com": $css_file = "duquesa_logo.css"; break; } return $baselink . $css_file; } Any help would be much appreciated Geoff Link to comment https://forums.phpfreaks.com/topic/200701-multiple-domains-change-logo-_serverserver_name/#findComment-1053204 Share on other sites More sharing options...
geoff777 Posted May 5, 2010 Author Share Posted May 5, 2010 bump Link to comment https://forums.phpfreaks.com/topic/200701-multiple-domains-change-logo-_serverserver_name/#findComment-1053393 Share on other sites More sharing options...
phpchamps Posted May 5, 2010 Share Posted May 5, 2010 Hello, You will have to call the function for include CSS. <link href="<?php echo get_css();?>" rel="stylesheet" type="text/css"> You can use above mentioned syntax call function. Regards, phpchamps Link to comment https://forums.phpfreaks.com/topic/200701-multiple-domains-change-logo-_serverserver_name/#findComment-1053406 Share on other sites More sharing options...
geoff777 Posted May 5, 2010 Author Share Posted May 5, 2010 Thanks, I put the switch into a file logo_css.php I want this in the headerinclude of a vBulletin forum but it's not working at all. <?php include 'http://www.the-rock-of-gibraltar.com/forums/logo_css.php'; ?> <link rel="stylesheet" href="<?php print get_css(); ?>" type="text/css" /> Link to comment https://forums.phpfreaks.com/topic/200701-multiple-domains-change-logo-_serverserver_name/#findComment-1053457 Share on other sites More sharing options...
phpchamps Posted May 5, 2010 Share Posted May 5, 2010 Hello, Dont include file using http may be fopen is disabled at your end. include file like include_once("c://wampp/localhost/answers/05may/1.php"); Link to comment https://forums.phpfreaks.com/topic/200701-multiple-domains-change-logo-_serverserver_name/#findComment-1053476 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.