I was wondering if anybody knows how to display an image based on the url of a website. I have one website running on two different domain names and I would like the logo to change bases on the url.
This is what ive got but it doesn't seem to work:
$url = $_SERVER['HTTP_HOST']
if ( $url = 'www.example.com')
echo "<a href=\"/\"><img src=\"img/logo.gif\" border=0></a>";
else if ( $url = 'www.example2.com' )
echo "<a href=\"/\"><img src=\"img/logo2.gif\" border=0></a>";
First you shouldn't do that for SEO purposes, duplicate content but anyhow there is something I use to do in the past.
saved images (logo) as domain.ie and domain.com then used php to set the path.
<img src='images/".str_replace("www.","",$_SERVER['HTTP_HOST']).".gif' alt='' />