1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to rotate 2 HTML code

Discussion in 'HTML & Website Design' started by Wellwisher316, Jan 18, 2014.

  1. #1
    Hey guys i am looking for something that can rotate 2 html codes every times page is refreshed or another url on same domain in visited.

    Any help would be greatly appreciated :)
     
    Wellwisher316, Jan 18, 2014 IP
  2. mbaldwin

    mbaldwin Active Member

    Messages:
    215
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    95
    #2
    you'll need to look to php or another server side script for this, not html.
     
    mbaldwin, Jan 18, 2014 IP
  3. Curtis Mangione

    Curtis Mangione Member

    Messages:
    14
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    25
    #3
    php would be the easiest way. Here is the logic

    GENERATE RANDOM NUMBER BETWEEN 0 and 1
    IF NUMBER = 0 --> SHOW FIRST HTML CODE
    IF NUMBER = 1 --> SHOW SECOND HTML CODE
    .
    .
    .

    Continue it as much as you want. PHP takes care of this server side so it will determine what block of HTML code to send to the user
     
    Curtis Mangione, Jan 22, 2014 IP
  4. Murugesan.quadraincorp

    Murugesan.quadraincorp Greenhorn

    Messages:
    15
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    23
    #4
    Hi,
    You try This code using java script rotate your Page on load....

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    var urls =['your site address','http://www.google.com'];var pos =0;
    next();
    setInterval(next,5000);// every 5 seconds
    functionnext()
    {
    if(pos == urls.length) pos =0;// reset the counter

    document.getElementById('rotate').src = urls[pos];
    pos++;
    }
    </head>
    <body>

    <iframeid="rotate">Some text</iframe>

    </body>
    </html>
     
    Murugesan.quadraincorp, Jan 23, 2014 IP
  5. shaon99

    shaon99 Well-Known Member

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    111
    #5
    Move your content with this coad

    <marquee>Hello world</marquee>

    Copy and pest your website then Hello world mooving
    Thanks
    you need more help go here..
    http://w3schools.com/
     
    shaon99, Jan 25, 2014 IP
  6. Wellwisher316

    Wellwisher316 Member

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #6
    Thanks everyone for help i found my solution now via plugin. Thankyou :)
     
    Wellwisher316, Jan 29, 2014 IP