shaneR 0 Posted April 26, 2007 Report Share Posted April 26, 2007 HI i wonder if anyone knows any neat code to place onto my site?Basically i have two different domain names running from the same site and i need to have a different logo display depending on the URL used to access my site.Any ideas? Quote Link to post Share on other sites
jesh 0 Posted April 26, 2007 Report Share Posted April 26, 2007 If you are looking for a client-side solution, it could look something like this in java script: <img id="LogoImage" width="500" height="60" /> var img = document.getElementById("LogoImage");if(location.href.indexOf("firstdomain.com") > -1){ img.src = "firstdomainlogo.gif";}else{ img.src = "seconddomainlogo.gif";} Quote Link to post Share on other sites
shaneR 0 Posted May 11, 2007 Author Report Share Posted May 11, 2007 Thanks for your input!!I have found some similar code to that above which works really well please see below i hope this helps others out who have the same problem as me.<%strServerName = Request.ServerVariables("SERVER_NAME")If InStr(strServerName, "mydomain.com") Then strImage = "<img src=""first image"" width=""473"" height=""35"">"Else strImage = "<img src=""ialternate image"" width=""404"" height=""38"">"End If%>Place the below string where you want the image(s) to be displayed.<%= strImage %> Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.