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

IFrame just in some % of visitors?

Discussion in 'Black Hat SEO' started by luizeba, Feb 27, 2009.

  1. luizeba

    luizeba Regular Member

    Joined:
    Dec 24, 2008
    Messages:
    458
    Likes Received:
    174
    Occupation:
    Studant
    Location:
    Brazil
    Hello mates.

    I really need to know if is possible to set a % of visitors to 'open' an IFrame in my website...

    I wanna test a easy-traffic method, but I need to limit the visitors of my website opening this IFrame (if this method works, I'll post it in BHW, of course -.-)
     
  2. Croix

    Croix Registered Member

    Joined:
    Feb 11, 2009
    Messages:
    81
    Likes Received:
    11
    <?
    // random number 1 - 100
    $result_random=rand(1, 100);

    // if result less than or equal 70, display ad 1 (70%)
    if($result_random<=70){
    include ("iframe.html" );


    // if result less than or equal 100, display ad 2 (30%)
    elseif($result_random<=100){
    include ("noiframe.html" );
    }

    ?>

    That work !
     
  3. bigvito21

    bigvito21 BANNED BANNED

    Joined:
    Jun 17, 2011
    Messages:
    272
    Likes Received:
    8
    I might try this
     
  4. VIC SEO

    VIC SEO Elite Member

    Joined:
    Feb 19, 2010
    Messages:
    2,156
    Likes Received:
    363
    Gender:
    Male
    Occupation:
    SEO Specialist
    Location:
    iSynergyMedia
    Home Page:
    Google don't like Iframes Missy. If I were you I would do my research on the likes and dislikes of Google and iframes are definitely in the dislike colomn.
     
  5. Autumn

    Autumn Elite Member

    Joined:
    Nov 18, 2010
    Messages:
    2,197
    Likes Received:
    3,041
    Occupation:
    I figure out ways to make money online and then au
    Location:
    Spamville
    Absolute nonsense. Iframes are used all over the place in the modern web 2.0 world. Regular framesets (as opposed to iframes) are no good for SEO but who the hell uses frames anymore?

    Here's how you'd do it in PHP, you'd just insert this wherever you wanted to show the iframe on your page.

    Code:
    <?php
    
    // Percentage of time to show an iframe
    $percent_show_iframe = 30;
    
    // Iframe html
    $iframe = '<iframe src="blahblah.html"></iframe>';
    
    $x = mt_rand(1, 100);
    
    if($x < $percent_show_iframe) {
    	echo $iframe;
    }
    
    </php>
    
     
  6. bigvito21

    bigvito21 BANNED BANNED

    Joined:
    Jun 17, 2011
    Messages:
    272
    Likes Received:
    8
    Is there a code for this for html?