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

Random iframe rotater that shows once per visitor

Discussion in 'White Hat SEO' started by bigvito21, Oct 20, 2011.

  1. bigvito21

    bigvito21 BANNED BANNED

    Joined:
    Jun 17, 2011
    Messages:
    272
    Likes Received:
    8
    Does any know a code or a site I can get that from?
     
  2. ibins

    ibins Junior Member

    Joined:
    May 9, 2011
    Messages:
    176
    Likes Received:
    39
    Location:
    really world wide
    PHP:
    <?
    $urls=array(
    'http://www.apple.com',
    'http://www.yahoo.com',
    'http://www.bing.com',
    'http://www.nicetranslator.com',
    'http://www.articlequeen.com',
    'http://www.blackhatworld.com'
    );

    $count count($urls);
    $randc rand(0,$count-1);
    $out   $urls[$randc];
    ?>
    HTML:
    <iframe src="<?=$out?>" width="1000" height="500" frameborder="0"></iframe>
     
  3. bigvito21

    bigvito21 BANNED BANNED

    Joined:
    Jun 17, 2011
    Messages:
    272
    Likes Received:
    8
    iframe rotator

    <script type='text/javascript'>
    var pages = new Array();
    pages[0] = "http://www.theyxxx.com";
    pages[1] = "http://www.yahoo.com";

    var time = 4;

    var i = 0;
    function setPage()
    {
    if(i == pages.length)
    {
    i = 0;
    }
    document.getElementById('holder').setAttribute('src',pages);
    i++;
    }
    setInterval("setPage()", 8000);
    // do not edit
    </script>
    <script type="text/javascript">
    if (window.jstiming) window.jstiming.load.tick('headEnd');
    </script>

    <div class='navbar section' id='navbar'></div>
    <p> </p>
    <iframe frameborder='0' id='holder' scrolling='yes' src='' style='width: 100%; height: 100px ' target='_blank'></iframe>
    <script type="text/javascript"></script>




    Iframe Displays Once Only

    <html>
    <head>
    <title>Iframe Displays Once Only</title>

    <script type="text/javascript">
    function createCookie(name,value,days) {
    if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
    }

    function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
    var c = ca;
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
    }

    function eraseCookie(name) {
    createCookie(name,"",-1);
    }

    </script>

    </head>
    <body>

    <iframe id = "myFrame" src = "myIframeSource.html">
    </iframe>

    <script type="text/javascript">

    // this script must be located after the iframe has loaded.

    var ifrName = document.getElementById("myFrame");
    if(!readCookie('visitedPreviously')) {
    document.write(' Your Message Goes Here And You See It Only Once ');
    ifrName.style.display='block';
    createCookie('visitedPreviously', 'visitedPreviously', 365); // 365 days persistence
    }
    else {
    ifrName.style.display='none';
    }

    //eraseCookie('visitedPreviously'); // FOR TEST PURPOSES

    </script>
    </body>
    </html>




    I have an iframe rotator and an iframe that shows once per user, how could I merge them into one to have an iframe to show randomly and one time per visitor?