Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

calling web site

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Folks
Here is my problem. I need to determine which web site called ours.
For example if the user did a search in yahoo.com and this provided a link to our website, how could I determine that the previous site was www.yahoo.com?
I need to do this for marketing reasons!!! They want to know who is coming to our site via which search engine.
cheers Paul
 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at the "HTTP_REFERER" field in the HTTP headers via getHeader(String name) in the request object.
<%=req.getHeader("Referer")%>
 
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HTTPRequest headers has the Referer header that you can check.
 
Paul Richards
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the replies
I have tried using your suggestion and using the following code
<%String url = new String();
url = request.getHeader("Referer");
System.out.println(url);%>
I actually got this
http://209.185.240.250/cgi-bin/linkrd?_lang=EN&lah=13ee0e019bbebffce9957610d0f949ac&lat=1017859774&hm___action=http%3a%2f%2fwww%2econfused%2ecom%2fpages%2findex%2ejsp%3fMediaCode%3 d122
as the url
This is not what I was quite expecting, have I done something wrong?
thanks in advance Paul
reply
    Bookmark Topic Watch Topic
  • New Topic