Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display image or log or text dynamically

Status
Not open for further replies.

920506

Programmer
Jun 13, 2003
201
US
Hi,Anybody can help me?
Many of our business partners have a link towards our website. When any user click the link in our partner's web page which links to our website, how to display the specific image, logo etc based on business partner's domain name dynamically. Or is there any other way to do that?
I am just a beginner of JavaScript
Thanks
Betty
 
I assume you know the location and the name of the logos . I usually ask them to place the logos in /images folder.

Code:
Dim strPartnerURL

'get partner URL
strPartnerURL = Request.ServerVariables("HTTP_HOST") 

'partner logo
<img border="0" src="[URL unfurl="true"]http://<%=strPartnerURL%>/images/logo.jpg"[/URL] alt="My partner logo">
 
You can set logo.jpg as variable like this:

Code:
Dim logo
If strPartnerURL = "[URL unfurl="true"]www.partner1.com"[/URL] Then
   logo = "logo1"  'name of the logo
elseif strPartnerURL = "[URL unfurl="true"]www.partner2.com"[/URL] Then
   logo = "logo12"  'name of the logo
'......so on
end if
 

<img border="0" src="[URL unfurl="true"]http://<%=strPartnerURL%>/images/<%=logo%>.jpg"[/URL] alt="My partner logo">
 
Hi, Kendal,
Thanks for that. I just modify on the *.html webpage. For the part of your code to work, do I have to change the whole *.html file into *.asp file? Or is there other way to get around?
Thanks
Betty
 
This Request.ServerVariables("HTTP_HOST") is ASP stuff...
so you will have to change html to asp for the code to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top