1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Hiding referrer

Discussion in 'Programming' started by themole, Jul 16, 2006.

  1. #1
    I need to hide/mask the referrer for outgoing links on my site. One way that seems to work is using a meta refresh tag to the page I want to go to:

    <meta http-equiv="refresh" content="1;url=http://www.domain.tld/page.htm">

    I've checked and javascript doesn't see a referrer, nor does PHP. Anyone else have any better ideas or know of problems with using the meta redirect?

    Thanks
    -the mole
     
    themole, Jul 16, 2006 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    in PHP you can force set the referer. So you can literally do a server-side redirect and say the referer is "http://www.google.com" or whatever you want..
     
    ccoonen, Jul 18, 2006 IP
  3. gumbo

    gumbo Peon

    Messages:
    54
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Doing the meta refresh is the only way I've seen sites hide the referrer info.

    ccoonen, can you elaborate? I've never heard of that and it sounds like you've found a bug in web browser software if that's really possible.
     
    gumbo, Jul 19, 2006 IP
  4. surfnearnzone

    surfnearnzone Well-Known Member

    Messages:
    1,492
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #4
    there is one more way. If you are using asp then you can do this. create a folder in your site. create a default.asp or index.asp file in it, whichever is your default document and paste this code

    <%
    response.redirect("your affiliate or refferer URL")
    %>

    Whenever you need to give your referrer url give this redirect url instead. So it will read www.yoursite.com/yourFolder rather than www.yourPromotedSite.com/refer?yourID

    You can also use this to track statistics or hits to your reffer URL

    Edit:

    This lightening fast than the meta refresh method. There might be some similar method in php too but i am an asp guy.
     
    surfnearnzone, Jul 20, 2006 IP
  5. gumbo

    gumbo Peon

    Messages:
    54
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This sounds like doing header('Location:URL') in PHP, which is a 302 redirect.
     
    gumbo, Jul 20, 2006 IP
  6. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #6
    you can set the super global variables. You know how you can $_GET['productID']; to get the productID querystring variable? You can also set these variables like: $_GET['productID'] = 0;

    $_SERVER["HTTP_REFERER"] is also modifyable ;) - but I haven't tried it on php 5+ so they might have "fixed" the bug but it's how all the Traffic-Trading scripts work. This way you can pop open a new window and redirect to the page you want - forcing a referer.
     
    ccoonen, Jul 22, 2006 IP
  7. gumbo

    gumbo Peon

    Messages:
    54
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    But how is setting the referrer variable on the server going to get it back to the client so it can send it to the new site? And this would be a browser bug, not a PHP bug. PHP should be able to return anything it wants, but the browser shouldn't let the referrer be set by the server.
     
    gumbo, Jul 22, 2006 IP
    themole likes this.
  8. themole

    themole Peon

    Messages:
    82
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I don't want to modify what my server sees as the referrer ($_SERVER["HTTP_REFERER"] in this case) but I want to hide the referrer from the remote server. (eg, when they click a link on my page that goes to another site) With a meta redirect the browser doesn't seem to pass the referrer from what I've seen. I've only tested in Firefox though.

    Thanks for input guys. Let me know if you find/think of anything else

    -the mole
     
    themole, Jul 22, 2006 IP
  9. fm91dot7

    fm91dot7 Peon

    Messages:
    80
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    This is a good idea
     
    fm91dot7, Mar 19, 2007 IP
  10. ednit

    ednit Peon

    Messages:
    152
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If you have the ability to run perl scripts on your server, I will PM you a script that will do this. I don't want to post it openly, but it worked for me when I tested it.
     
    ednit, Mar 20, 2007 IP