Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Spoof HTTP_Referrer and redirect?

    I'm changing domains for a store of mine... say from aaa.com to bbb.com.

    aaa.com is using Post Affiliate Pro which has a cool feature called "direct linking." What happens is that the affiliate registers their URL with PAP, and then can use any link to any page on aaa.com. A script on aaa.com reads the http_referrer info and, if it matches something in the database, places a cookie for the appropriate affiliate.

    Well, since I'm moving to bbb.com, I'd LOVE to help out my affiliates and not require them to change all their links to aaa.com... BUT, I don't actually want to redirect the user to the new site.

    So, I'm thinking that what I really want to do is cookie stuff my own site ;-)

    On aaa.com, put some code that in a 1px iframe or 1px img tag opens the new site... but opens it by sending the original http_referrer. That way the PAP code on bbb.com will recognize the referrer info and place a cookie for the referring affiliate.

    Thoughts?
    Last edited by sashen; 01-30-2012 at 07:38 PM.

  • #2
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Quote Originally Posted by sashen View Post
    I'm changing domains for a store of mine... say from aaa.com to bbb.com.

    aaa.com is using Post Affiliate Pro which has a cool feature called "direct linking." What happens is that the affiliate registers their URL with PAP, and then can use any link to any page on aaa.com. A script on aaa.com reads the http_referrer info and, if it matches something in the database, places a cookie for the appropriate affiliate.

    Well, since I'm moving to bbb.com, I'd LOVE to help out my affiliates and not require them to change all their links to aaa.com... BUT, I don't actually want to redirect the user to the new site.

    So, I'm thinking that what I really want to do is cookie stuff my own site ;-)

    On aaa.com, put some code that in a 1px iframe or 1px img tag opens the new site... but opens it by sending the original http_referrer. That way the PAP code on bbb.com will recognize the referrer info and place a cookie for the referring affiliate.

    Thoughts?
    This sound an awful lot like a job offer I turned down recently. I strongly advised against cookie stuffing, or any black hat techniques found by simply googling, as they won't work for long (if they work at all). Black hat stuff, in my opinion, leads to loss rather than gain.

    Also, this post is kind of breaking the rules as we would be helping you violate a service's terms and conditions and, effectively, steal money from them.
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •