Linking back to specific referrer sites... How to?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Haitashi
    New Member
    • Jun 2007
    • 96

    Linking back to specific referrer sites... How to?

    There are many ways to reach my site. But I what I'm trying to accomplish is to test if the user comes back from 3 specific sites. If they are linking to my site from theirs, I want to store that info in a variable to dynamically create a URL that links back to that original site.

    I was thinking that I could use CGI.http_referr er and somehow test if it contains specific URL info. And if it contains any of those 3 sites then save the content to a variable.

    Can I even test of specific text exists as part of CGI.http_referr er? I also think that I need to test for the domain and have it completely ignore any sub directory (so that blabla.com & blabla.com/home/ would both come back as 'true' if I test it for the blabla.com string).

    Any suggestions?
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use it as a string. Use a combination of string functions (find, refind, left, mid, etc.) or perhaps someone has already written a UDF over on cflib.org

    Comment

    • Haitashi
      New Member
      • Jun 2007
      • 96

      #3
      Thanks. Even though your suggestion worked (I saved the referrer info and would do a find. If it found any piece of the URLs I needed, then it would set a variable to contain that info).

      Even though in theory this should work. However, we would sometimes end up with unreliable information inside the referrer and this would cause errors. Mostly from users using the BACK and FORWARD button to navigate around.

      I decided not to implement this feature until I find a safe and proved method to do it. Thanks anyways!

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Yes, cgi.http_refere r is unreliable. It's even spelt incorrectly! The user can spoof or disable it or the firewall can block it. Not something that can be relied upon.

        Comment

        • Haitashi
          New Member
          • Jun 2007
          • 96

          #5
          I've decided to abandon this idea for now. If I do find a reliable way, I'll post back.

          Comment

          Working...