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

Help with iframe script.

Discussion in 'HTML & JavaScript' started by jdem02, Nov 26, 2011.

  1. jdem02

    jdem02 Registered Member

    Joined:
    Jan 16, 2010
    Messages:
    56
    Likes Received:
    1
    Ok I have a simple script iframe script i use after people sign up for my mailing list. They confirm email and they hit an offer page. I'm wondering if I can rotate urls so when the next person visits it's a different offer. Thanks!
    Code:
    <html>
    <head>
        <title>Thanks For Subscribing</title>
        <meta name="keywords" content="Page Title Here " />
        <meta name="description" content="Page Title Here " />
        
        <style>
        * {
            margin: 0;
            padding: 0;
        }
        body {
            margin: 0;
            padding: 0;
        }
        </style>
    </head>
    
    <body>
    <img src="url">
        <iframe src="url" width="100%" height="100%" frameborder="0" marginheight="0" marginwidth="0">
            <p>Click <a href="url">here</a>! (Your browser does not support iframes)</p>
        </iframe>
    </body>
    </html>
     
  2. xpwizard

    xpwizard Junior Member

    Joined:
    Nov 6, 2010
    Messages:
    198
    Likes Received:
    122
    Code:
    <?php
    
    // define offer urls
    $offers = array();
    $offers[] = "http://myfirstoffer.com";
    $offers[] = "http://mysecondoffer.com";
    $offers[] = "http://mythirdoffer.com";
    $offers[] = "http://myfourthoffer.com";
    
    ?>
    <html>
    <head>
        <title>Thanks For Subscribing</title>
        <meta name="keywords" content="Page Title Here " />
        <meta name="description" content="Page Title Here " />
        
        <style>
        * {
            margin: 0;
            padding: 0;
        }
        body {
            margin: 0;
            padding: 0;
        }
        </style>
    </head>
    
    <body>
    <img src="url">
        <iframe src="<?php echo $offers[array_rand($offers)]; ?>" width="100%" height="100%" frameborder="0" marginheight="0" marginwidth="0">
            <p>Click <a href="url">here</a>! (Your browser does not support iframes)</p>
        </iframe>
    </body>
    </html>