1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Anyone know how to do a CONDITIONAL page load? based on referrer?

Discussion in 'Cloaking and Content Generators' started by Siek, Oct 2, 2008.

  1. Siek

    Siek Regular Member

    Joined:
    Feb 4, 2008
    Messages:
    456
    Likes Received:
    294
    I have a blackhatsite (we'll call this BH1) that is PHP redirected to my other site (BH2)... I used a PHP redirect to make sure the referrer is passed...

    On BH2 - i have an iframe on it which passes the referrer.. I do not want to remove this iframe so it will definately send the referrer to the networks..

    I've been using a conditional http referrer check redirect - Since all my traffic is filter through BH1 and the condition is met that BH1 is the referrer for BH2..then it'll do nothing and stay on the page..which is great and all..

    BUT there seems to be a small delay between the BH2 to the whitehat site (WH)... networks will definately see the BH2 for a couple of seconds..which could be bad..

    heres the script im using on the BH1 site
    Now what i want to know is. uhh is there a way where you can make the actualy page load up only if BH1 is the site referrer? For instance, i don't want that iframe to load until after the referrer check? Such as a body onload or something like that... Any ideas?

    Thanks in appreciated

    Siekk
     
  2. littlewebdragon

    littlewebdragon Jr. VIP Jr. VIP Premium Member

    Joined:
    Dec 30, 2007
    Messages:
    867
    Likes Received:
    228
    Occupation:
    Occupation
    Location:
    Location
    There is no delay, that delay is speed of doing if condition and that is really really fast!

    Why don't you use header(); instead of http refresh it's faster...

    Something like this:
    Code:
    if(##yourconditionhere){
         //do something
    }else{
        header("Location:http://www.WH.com/");
    }
    
    
    I didn't understood well what is that you want to achieve... Please explain...
     
  3. Siek

    Siek Regular Member

    Joined:
    Feb 4, 2008
    Messages:
    456
    Likes Received:
    294
    i want the BH2.php page to show its content if a http referrer == "BH1.php". If not they the page is redirected to the offer. The reason i want this is b/c i want the network to be redirected to the offer when checking my domain b/c they won't pass the http referrer == check and then as a result will be redirected.
     
  4. Siek

    Siek Regular Member

    Joined:
    Feb 4, 2008
    Messages:
    456
    Likes Received:
    294
    Is this even possible? To show the rest of a site after having a certain condition correct? it seems very possible but can't find an answer anywhere.. hmmmmmmm
     
  5. forgot

    forgot Jr. VIP Jr. VIP Premium Member

    Joined:
    May 3, 2008
    Messages:
    936
    Likes Received:
    706
    Location:
    BlackhatWorld
    I may help u, go to getafreelancer, post a shit project, and when u get the bid, ask the coder as a test this question.



    Regards
     
  6. mattstrike

    mattstrike Regular Member

    Joined:
    Sep 29, 2008
    Messages:
    208
    Likes Received:
    76
    Occupation:
    Internet Marketing Arms Dealer
    Location:
    USA
    Home Page:
    The root problem is totally solvable, although you might want to look at it from a different angle.

    Let me restate your example, and then I'll put a new twist on it:

    You have a page, BH1, which directs traffic to another page, BH2, which does its iframing magic, etc. However, BH2 also gets legit traffic from somewhere else. Currently, when the legit traffic comes in, BH2 then redirects to yet another page, WH1, and does whatever it does, but without the iframing etc.

    What I am wondering, is why redirect at all? If the traffic is hitting BH2 anyway, then just put both pages in one PHP doc, and use the referrer to switch which page gets rendered. No redirect, but each traffic set gets its own version of the page. Additionally, to my way of thinking, there is less of a chance of having someone look at the link in your WH traffic, and compare it to the final destination, and ask questions about what is happening in the middle.

    If I'm missing something obvious about your method, and why the redirection is essential, let me know. I've been developing sites for a long time, and have done a lot of IM Websites (for others), but have recently decided to see if I can get a seat at the table instead of taking scraps off the floor. Thank goodness I came across BHW, but it still makes me feel like a noob all over again. ;)
     
  7. jammie

    jammie Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 24, 2008
    Messages:
    773
    Likes Received:
    453
    why not flip your if statement? use not equals (!=) instead of equals (==), so that you have:

    <?php
    $referer = $_SERVER['HTTP_REFERER'];
    if($referer != "hxxp://www.BH1.com")
    {
    header (location: http://www.BH2.com);
    }
    ?>

    make the code abit neater and more effcient.

    the header redirect also keeps referer so if you're faking its better to use that once its faked.