Forum Moderators: open

Message Too Old, No Replies

Lookiing for Script

         

flagflag

4:37 pm on Jan 29, 2006 (gmt 0)

10+ Year Member



Hello

I am looking for a java script that will insert an image to a website based on the website the visitor came from..... any help would be appreciated :-)

[edited by: DrDoc at 4:52 pm (utc) on Jan. 29, 2006]
[edit reason] no personal info, please [/edit]

JAB Creations

8:09 pm on Jan 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello Flagflag, sounds like you're looking for...

document.referrer

This might work and it's a bit of a mess but...

if (document.referrer = "http://example.com")
{
document.write('<img alt="" src="example-com.jpg" />"');
}

I would suggest doing this serverside however, do you use or allowed to use any serverside language?

John

flagflag

8:56 pm on Jan 29, 2006 (gmt 0)

10+ Year Member



John

I thin I can do sirver side stuff, not an expert in the stuff. I tired your code and it errored. can you help me and tell me what <script> code I need to surround your code with? Thanks a ton!

Scally_Ally

9:29 pm on Jan 29, 2006 (gmt 0)

10+ Year Member



heres how you do it in oldskool asp

<%
if request.ServerVariables("HTTP_REFERER") = "www.example.com" then
%>
<img src="example.gif">
<%
end if
%>

flagflag

9:49 pm on Jan 29, 2006 (gmt 0)

10+ Year Member



I need to insert this into an asp template file. ASP code will not run.....

I'd like to get a java scipt to work.

Once again, sorry, newbie here