Irish SEO,  Marketing & Webmaster Discussion

 
Chitika Malls

php image display problem

This is a discussion on php image display problem within the Coding Help forums, part of the Webmaster Help category; Hey I was wondering if anybody knows how to display an image based on the url of a website. I ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Coding Help

Register Forum Rules FAQDonate Members List Calendar Search Today's Posts Mark Forums Read


Notices

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-05-2007, 09:57 PM
david4ie's Avatar
Frontpage User
Recent Blog:
 
Join Date: Nov 2006
Posts: 20
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
david4ie will become famous soon enough
Send a message via MSN to david4ie
Default php image display problem

Hey

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:
PHP Code:
<?php
$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>";
}
?>
Thanks
__________________

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 08-05-2007, 11:03 PM
niall's Avatar
Hosting Caretaker
 
Join Date: Jan 2007
Location: Carlow
Posts: 65
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
niall will become famous soon enough
Send a message via ICQ to niall Send a message via MSN to niall
Default

Quote:
Originally Posted by david4ie View Post
PHP Code:
<?php
if ( $url 'www.example.com'
?>
= on it's own isn't a comparison operator. You need ==

This is the one that has bitten everyone on the ass at some stage.
__________________
Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 08-05-2007, 11:06 PM
louie's Avatar
Senior Member
 
Join Date: Jan 2006
Location: Dublin, Ireland
Posts: 2,038
Nominated 5 Times in 3 Posts
Nominated TOTW/F/M Award(s): 1
louie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enough
Send a message via Yahoo to louie Send a message via Skype™ to louie
Default

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.
PHP Code:
<img src='images/".str_replace("www.","",$_SERVER['HTTP_HOST']).".gif' alt='' /> 
__________________
:. Web Design & Development Web Design Ireland
:. Search Engines Optimization Search Engines Optimization
:. Directory Submission Directory Submission
:. News & Press Release Ireland GiveItSocks.com
:. Used Cars Ireland, Car Parts & Car Audio Cars For Sale, Car Parts & Accessories
:. I Have 2 Find It Directory SEF Directory
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
display, image, php, problem

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Google Images - Display Method - How is it done? davidbehan Coding Help 10 12-01-2007 05:09 PM


Sponsored links

Paid On Results


All times are GMT +1. The time now is 09:45 AM.


Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.2.0