Announcement

Collapse
No announcement yet.

Referrer triggering different images

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Referrer triggering different images

    Hello, I'm hoping someone with superior knowledge can shed some light on this.

    I am currently gearing my site up to allow for some affiliates, I have set up referrer.pl and it works fine.

    What I would ideally like to be able to do is change the header image / css of our site slightly for people entering via each different referrer.

    Is there any way of extracting the referrer name from referrer.pl and using it in some sort of cunning php / javascript thing to trigger an alternate image?

    I can hopefully work it out myself once I get started on the right path so any suggestions gratefully received.

    (Using Multi-User 8)
    Police Equipment & Tactical Gear at CopShopUK

    Safety Boots & Work Boots at BootShopUK

    #2
    JavaScript might be enough.

    Try temporarily putting:
    Code:
    <script type="text/javascript">
    document.write(getCookie('ACTINIC_REFERRER'));
    </script>
    Onto a page and see what gets displayed. If suitable, you could test getCookie('ACTINIC_REFERRER') and use to display alternate code if from a known site.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks for your input Norman

      I tried your suggestion and fiddled with some other bits but it just seems to return the name of the current page (like a document.location.href sort of thing) rather than the referrer.

      Tried playing with document.referrer but it only records the last page viewed, I need something a bit less temporary.
      Police Equipment & Tactical Gear at CopShopUK

      Safety Boots & Work Boots at BootShopUK

      Comment


        #4
        Try this code instead. It detects the referrer string (if present) and copies it to a cookie that doesn't get munged when you load subsequent pages.
        Code:
        <script type="text/javascript">
        var refbits = getCookie('ACTINIC_REFERRER').match(/SOURCE=(.*)&DESTINATION/);
        if ( refbits != null )
        	{
        	setCookie('TRUE_REFERRER', refbits[ 1 ])
        	}
        document.write(getCookie('TRUE_REFERRER'));
        </script>
        You should now be able to use getCookie('TRUE_REFERRER') to return the referrer name.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment

        Working...
        X