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

iFrame redirect after 3rd party form submit

Discussion in 'Cloaking and Content Generators' started by marinemerchant, Aug 26, 2009.

  1. marinemerchant

    marinemerchant Newbie

    Joined:
    Aug 8, 2009
    Messages:
    10
    Likes Received:
    14
    For those who do not have godcpa (I actually don't prefer how he handles redirects though), here is a script to get you started if you want to redirect on submit a form loaded in an iframe. I found history.length to be unreliable because you can't control their history.length unless you popup a new window (and risk pop blocked).


    • Paste/merge the script code into your iframe page
    • Remove // from alert(k);
    • Call the function iFrame() using onload= in your iframe tag
    • Alert will popup telling you what # k is a few times. When it is done add 1 to that #. (In my case k was 4, so add 1 is 5)
    • See (k!=5) and (k==5), good now change my 5 to whatever your # was (after you added 1)
    • Add // back to alert(k); b/c it's annoying
    • Change thankyou.php (you can load pages or URL) and/or 3000 (this is how long to wait for redirect in milliseconds)

    Code:
    <script type='text/javascript'> 
    
    var k=1;
    
    function iFrame()
    {
        if(k!=5)
        {
        k=k+1;
        //alert(k);
            if(k==5)
            {
            window.setTimeout('window.location="thankyou.php"; ',3000);
            }
        }
    }
    
    </script>
    
    Need more information? Read this http://www.blackhatworld.com/blackhat-seo/cloaking-content-generators/88007-iframing-closing-iframe-after-submit.htmlthat started this script. Problem with the script at the bottom of that post is it doesn't check how many pages (redirects) loaded in the iframe.
     
    • Thanks Thanks x 5
  2. marinemerchant

    marinemerchant Newbie

    Joined:
    Aug 8, 2009
    Messages:
    10
    Likes Received:
    14
    Yeah I can read. Bah. If an admin can change the tags for this post to the proper format (using commas, not colons) I would appreciate it. That way it's easier to popup in site search.
     
  3. Graphic

    Graphic Newbie

    Joined:
    Feb 18, 2009
    Messages:
    24
    Likes Received:
    4
    Gender:
    Male
    Occupation:
    Web Designer / Graphic Designer / Programmer
    Location:
    Canada
    Home Page:
    Has anyone tried this script out?
    Please post your results.
     
  4. enSo

    enSo Regular Member

    Joined:
    Jul 15, 2009
    Messages:
    250
    Likes Received:
    301
    Occupation:
    Take a Guess
    Location:
    There's nothing that can go wrong with this. It's a pretty simple script and I'm pretty sure it has been used before.
    Of course, they can always click on other links than the submit buttons and it would still count as a hit. Which is pretty annoying, but the only way I can think of that would take care of this problem is way too complicated. So I guess it's better to be totally blackhat about it and never redirect to what you're promising them.
     
  5. kharm

    kharm Power Member

    Joined:
    Feb 9, 2009
    Messages:
    525
    Likes Received:
    97
    Occupation:
    Entrepreneurship
    is this meant to redirect immediately after filling in a form and clicking submit on an Iframed CPA offer?
     
  6. singingsleep

    singingsleep Regular Member

    Joined:
    Dec 13, 2008
    Messages:
    408
    Likes Received:
    384
    Occupation:
    Jack of all trades, master of... well... several,
    Location:
    Inbox
    Awesome if it works, unfortunately don't have time to try it but will be watching this thread for feedback. This is quite the eventful share if it does.
     
  7. marinemerchant

    marinemerchant Newbie

    Joined:
    Aug 8, 2009
    Messages:
    10
    Likes Received:
    14
    @ http://www.blackhatworld.com/blackhat-seo/members/32768-kharm.html

    After they press the submit button, function iFrame () triggers. See the setTimeout has the number 3000 in it. That's 3000 milliseconds it waits then redirects. You would place this script in the top of your iframe htm or php page. Unfortunately this would make it so someone could view source and see your redirect page or URL.

    With php or javascript you can reference another file and do a function from that file (which would have your redirect URL) so the viewer could not see it if you wanted though.
     
    Last edited: Sep 21, 2009
  8. kharm

    kharm Power Member

    Joined:
    Feb 9, 2009
    Messages:
    525
    Likes Received:
    97
    Occupation:
    Entrepreneurship
    I still have a lot to learn about javascript obviously :D. But for my purposes I am using double meta refresh script, not sure how to incorporate this into it, but I think I found a way around this without needing script for now. Thx for the share.
     
  9. drkenneth

    drkenneth Executive VIP

    Joined:
    Nov 13, 2008
    Messages:
    285
    Likes Received:
    176
    Occupation:
    Developer/Entrepreneur
    Location:
    USA
    Just have the window.location="thankyou.php" line send you to your double-meta page. That should take care of it. :)
     
  10. stupid

    stupid Newbie

    Joined:
    Dec 2, 2008
    Messages:
    5
    Likes Received:
    0
    Hi, thanks very much for this post. This is what I was looking for, but I am afraid I am not quite tech savvy enough to implement. Let's say I created an I frame with cake slice per the making-money/113780-guide-how-iframe-cpa-offers-while-blanking-referrer post by slicer. I understand your guidance except the part "Call the function iFrame() using onload= in your iframe tag". Can you give an example of how to do that please? Also does it matter where the javascript is placed (in header? before iframe?, after iframe?)

    Thanks very much for any help....
    --------------------------
    OK. I got it... in case anyone else is as clueless as me... see onload="iframe()" in the code below. All works well.
    <div style="overflow: hidden; width:602px; height:101px; position: relative;"><iframe src="urlofcpaoffer" style="border: 0pt none ; left:-183px; top:-329px; position: absolute; width:1155px; height:745px;" scrolling="no" onload="iFrame()"></iframe></div>
     
    Last edited: Jul 26, 2010